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: Shaun Wexler <email@hidden>
- Date: Wed, 20 Sep 2006 12:38:23 -0700
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 }
|
_______________________________________________
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