man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

get_nprocs(3C)

Name

get_nprocs, get_nprocs_conf - get number of processors

Synopsis

#include <unistd.h>

int get_nprocs(void);
int get_nprocs_conf(void);

Description

The get_nprocs() and get_nprocs_conf() functions are, respectively, equivalent to:

sysconf(_SC_NPROCESSORS_ONLN);

sysconf(_SC_NPROCESSORS_CONF);

Return Values

The get_nprocs() function returns the number of available processors. The get_nprocs_conf() function returns the number of processors the operating system configured.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See Also

sysconf(3C), attributes(5)

Notes

The get_nprocs() and get_nprocs_conf() functions are provided only as GNU/Linux compatibility interfaces.