sysconf

Name

sysconf -- Get configuration information at runtime

Synopsis

#include <unistd.h>

long sysconf(int name);

DESCRIPTION

sysconf() is as specified in POSIX 1003.1-2008 (ISO/IEC 9945-2009), but with differences as listed below.

Extra Variables

These additional values extend the list in POSIX 1003.1-2008 (ISO/IEC 9945-2009).

- _SC_PHYS_PAGES

The number of pages of physical memory.

- _SC_AVPHYS_PAGES

The number of currently available pages of physical memory.

- _SC_NPROCESSORS_CONF

The number of processors configured.

- _SC_NPROCESSORS_ONLN

The number of processors currently online (available).

Extra Versions

While this specification only requires conformance with POSIX 1003.1-2008 (ISO/IEC 9945-2009), implementations are not constrained from moving on and claiming conformance with a subsequent edition, POSIX 1003.1-2008 (ISO/IEC 9945-2009). Thus for run-time checks using sysconf(), the wording is amended to allow return values of 0, -1, 200112L or 200809L where formerly 200809L was not listed as allowed.