[lsb-discuss] LSB-compliant way to get number of processors?

Nick Stoughton nick at usenix.org
Mon Aug 7 10:05:42 PDT 2006

The sysconf() interface itself is in the LSB.

But only the symbols defined in POSIX are required to be present. We
need to add several, including _SC_NPROCESSORS_ONLN. 

The following _SC_ symbols are defined on my FC5 system that are NOT in
the LSB:

-- quite a list! I see no reason why ALL these symbols shouldn't be
added to the LSB at 3.2, though it is possible/probable that some are
architecture specific.

On Mon, 2006-08-07 at 11:31 +0100, Alan Cox wrote:
> Ar Llu, 2006-08-07 am 10:01 +0100, ysgrifennodd Dallman, John:
> > > I've found two ways so far to ask Linux how many processors 
> > > it has: get_nprocs() and sysconf(_SC_NPROCESSORS_ONLN), but 
> > > neither of them seem to be allowed in LSB-compliant code. 
> > 
> > Any offers? If we can't find a way to do this, Parasolid on 
> > Linux is going to have to cease being LSB-compliant. This is 
> > not a prospect I welcome, but delivering what the customer
> > are actually asking for has to take priority over things 
> > they aren't bothered about. 
> sysconf really ought to be in the LSB for some of those queries. I'd
> agree its a bug if it isnt

Nick Stoughton                          Cell: 510 388 1413
USENIX Standards Liaison                Fax:  510 548 5738

More information about the lsb-discuss mailing list