Where is sysctl.proc_native documented? Other sysctl values?
Where is sysctl.proc_native documented? Other sysctl values?
- Subject: Where is sysctl.proc_native documented? Other sysctl values?
- From: "Dan Smith" <email@hidden>
- Date: Wed, 20 Sep 2006 13:17:44 -0400
http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_exec_a/chapter_7_section_7.html
gives some sample code by which a program can distinguish whether it's running native on an i386 system, under Rosetta on an i386, or on a Power Macintosh.
Now, as a matter of fact this program does not work as described. For example, "is_pid_native" is supposed to return 0 when running native on an i386 machine, but it actually returns 1. If I assume that sysctlbyname("sysctl.proc_native" ...) will read a value of 1 running native on i386, 0 running under Rosetta, and error out on a true Power Mac, it accounts for the observed behavior (and indicates how to fix the sample code).
The thing is, I haven't found any doucmentation that acknowledges the existence of sysctl.proc_native, let alone tells me what it is supposed to do. (Is it guaranteed to error out on all Power Mac versions of Mac OS X? Or could it possibly in future return 1, since Power Mac code is in fact running "native" on a Power Mac system?)
The sysctl utility, when run with sysctl -A, which is supposed to list everything, doesn't list any variable with any name like "native" or "proc_native."
And in fact I'm not finding much in the way of documentation on what the full set of sysctl variables is under Mac OS X, or, more to the point, anything that enumerates the set of possible values those variables can assume. Observation suggests that that sysctl("hw.machine") returns one member of the set {"i386", "Power Macintosh"}... but I can't find any place that says so.
Any pointers to documentation? Header files? Source code?
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden