Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where is sysctl.proc_native documented? Other sysctl values?



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
}

-- 
Shaun Wexler
MacFOH


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >Where is sysctl.proc_native documented? Other sysctl values? (From: "Dan Smith" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.