Re: sysctlbyname( "hw.availcpu" ) fails
Re: sysctlbyname( "hw.availcpu" ) fails
- Subject: Re: sysctlbyname( "hw.availcpu" ) fails
- From: Terry Lambert <email@hidden>
- Date: Mon, 25 Jun 2007 16:50:52 -0700
On Jun 23, 2007, at 4:38 AM, Steve Checkoway wrote:
$ ./a.out
sysctl: 2
sysctlbyname: No such file or directory
sysctlnametomib: No such file or directory
sysctl2: 2
$ sysctl hw.availcpu hw.activecpu
hw.availcpu = 2
hw.activecpu: 2
What is the difference between activecpu and availcpu, e.g., why
does one have an equal sign and the other a colon?
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.
The reason you get two of these is that one is by mib (and knowledge
is built into the sysctl command line tool) and the other is iterated
from the information in the kernel. Eventually, the mib-based one
will go away.
-- Terry
_______________________________________________
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