Re: Where is sysctl.proc_native documented? Other sysctl values?
Re: Where is sysctl.proc_native documented? Other sysctl values?
- Subject: Re: Where is sysctl.proc_native documented? Other sysctl values?
- From: Eric Albert <email@hidden>
- Date: Wed, 20 Sep 2006 14:23:43 -0700
On Sep 20, 2006, at 12:38 PM, Shaun Wexler wrote: On Sep 20, 2006, at 10:17 AM, Dan Smith wrote: ... 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.
Any pointers to documentation? Header files? Source code?
enum { SKWNativePPC, SKWRosettaPPC, SKWNativeI386 };
long SKWCurrentArch(void) { #if __i386__ return SKWNativeI386; #elif __ppc__ register long r; asm volatile (" li %0, 0\n b 0f\n .long 0x14400004\n li %0, 1\n 0:" : "=&r" (r)); return r; // r ? SKWRosettaPPC : SKWNativePPC; #else #error unknown arch #endif }
Please don't do anything like this. That's completely unsupported and could break. There's a documented way to figure out if you're running translated, and that's the only way you should check it.
-Eric
|
_______________________________________________
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