cpusetGetCPUCount - obtain the number of CPUs configured
on the system
SYNOPSIS
#include <cpuset.h>
int cpusetGetCPUCount(void);
DESCRIPTION
The cpusetGetCPUCount function returns the number of CPUs
that are configured on the system.
EXAMPLES
This example obtains the number of CPUs configured on the
system and then prints out the result.
int ncpus;
if ( !(ncpus = cpusetGetCPUCount()) ) {
perror("cpusetGetCPUCount");
exit(1);
}
printf("The systems is configured for %d CPUs\n",
ncpus);
NOTES
cpusetGetCPUCount is found in the library "libcpuset.so",
and will be loaded if the option --llccppuusseett is used with
cc(1) or ld(1).
RESTRICTIONS
Not all of the above capabilities are implemented. See
the RESTRICTIONS secion in manual entry cpuset(4) for
details.
SEE ALSO
cpuset(1), cpuset(5).
DIAGNOSTICS
If successful, cpusetGetCPUCount returns a value greater
than or equal to 1. If cpusetAttach fails, it returns the
value 0 and errno is set to indicate the error. The val
ues for errno include the following:
ERANGE Number of CPUs configured on the system is not a
value greater than or equal to 1.
Man(1) output converted with
man2html