• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sysctlbyname( "hw.availcpu" ) fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: sysctlbyname( "hw.availcpu" ) fails
      • From: Steve Checkoway <email@hidden>
References: 
 >sysctlbyname( "hw.availcpu" ) fails (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: A question of Rosetta.
  • Next by Date: Re: A question of Rosetta.
  • Previous by thread: sysctlbyname( "hw.availcpu" ) fails
  • Next by thread: Re: sysctlbyname( "hw.availcpu" ) fails
  • Index(es):
    • Date
    • Thread