System information

Different systems provide different ways for obtaining information about the system. On Berkeley Software Distribution (BSD) systems, the sysctl() interface provides access to system information. On System V systems, the sysinfo() call provides system information.

Some system information can be obtained using POSIX routines and some cannot. The POSIX system information routines return strings, paths, and numeric values, including two-valued Boolean conditions. The header file <limits.h> contains macros that define system limits.

confstr()
Retrieves string values. The only portable value is _CS_PATH, a value for PATH guaranteed to find the standard utilities.
fpathconf(), pathconf()
Retrieves configurable path name variables, such as the maximum size of a file name or the maximum link count. Used in System V programming.
sysconf()
Retrieves system information that can provide answers to questions such as the following: Is job control is available? Are POSIX options supported? What are the limits for bc? What is the maximum number of bytes allowed for an argument to exec()?

Interix Software Development Kit (SDK) also provides both uname() and gethostbyname().