Re: sysctlbyname( "hw.availcpu" ) fails
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com $ ./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 -- Terry _______________________________________________ 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... On Jun 23, 2007, at 4:38 AM, Steve Checkoway wrote: 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert