Re: sysctlbyname( "hw.availcpu" ) fails
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jun 25, 2007, at 4:50 PM, Terry Lambert wrote: Okay, I'll use that then. hw.ncpu = 1 hw.availcpu = 1 hw.ncpu: 1 hw.activecpu: 1 hw.logicalcpu_max: 1 hw.logicalcpu: 1 hw.physicalcpu_max: 1 hw.physicalcpu: 1 -- Steve Checkoway _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... activecpu is the correct name; the manifest constant name was not changed because people have existing code that has to compile vs. the MIB version of the call. The preferred method for all sysctls going forward is to use sysctlbyname(), so that's what you should use in new code. I did wonder about that. All of the examples I've seen on this list have been of the sysctlbyname() type. Is there a list of the sysctls that are guaranteed to exist on all machines (or by architecture). Also, a description of them would be nice. For example, on this computer sysctl -a|grep cpu gives me (among others): It isn't clear to me how ncpu and activecpu relate to the others. My guess is that ncpu is the same as logicalcpu_max and activecpu is the same as logicalcpu. I'm not at my G5 so I can't check my assumptions at the moment. The comments in the header do not mention physical/ logical for either ncpu or activecpu. This email sent to site_archiver@lists.apple.com
participants (1)
-
Steve Checkoway