>From: Chris Little <[EMAIL PROTECTED]>
>Date: Mon, 18 Sep 2006 15:56:43 -0400
>
>on 9/18/06 3:37 PM, Dan Smith at [EMAIL PROTECTED] wrote:
>
>> After some experimentation:
[snip]
>
>http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/
>universal_binary_exec_a/chapter_7_section_7.html

I was going to say "bingo!," and was getting ready to translate it to RB, but,
oddly enough, this code does not appear to work as described. It says it returns

//0 if the process is running natively on an Intel-based Macintosh computer
//–1 if the process is not native but running translated using Rosetta
//1 if version of Mac OS X predates Rosetta, which means the process is native
and running on a PowerPC Macintosh computer

On a Power Mac, it gives:

sysctlbyname_with_pid(0): sysctlbyname  failed:No such file or directory
is_pid_native(0) = 1

On an Intel Core Mac, where the program itself is running native, and process
#495 is running under Rosetta, it gives:

is_pid_native(0) = 1
is_pid_native(495) = 0

It would be very interesting to know whether this is just a bug (and whether
the code was not tested), or whether something changed in Mac OS X between the
time at was written and 10.4.7. SO far, haven't found good enough documentation
on sysctl and friends to be sure! 

I realize I'm spending more time on this than it deserves... but I've got the
bit in my teeth. 

Something else that doesn't work, probably to be expected, is the AppleScript
"system info" command, because when invoked from inside a PPC RB application
running in Rosetta, it itself runs under Rosetta, and it gets CPU type =
PowerPC 7400.







_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to