sysconf -- Get configuration information at runtime


#include <unistd.h>

long sysconf(int name);


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

Extra Variables

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


The number of pages of physical memory.


The number of currently available pages of physical memory.


The number of processors configured.


The number of processors currently online (available).

Extra Versions

While this specification only requires conformance with POSIX 1003.1-2001 (ISO/IEC 9945-2003), implementations are not constrained from moving on and claiming conformance with a susequent 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.