9.24 sysconf

#define SC_PAGESIZE         1 // Page size of the system.
#define SC_OPEN_MAX         2 // Maximum amount of files per process.
#define SC_HOST_NAME_MAX    3 // Maximum length of hostnames.
#define SC_AVPHYS_PAGES     4 // Number of free physical pages.
#define SC_PHYS_PAGES       5 // Number of total available pages.
#define SC_NPROCESSORS_ONLN 6 // Number of processors active and used.
#define SC_TOTAL_PAGES      7 // Total amount of installed memory pages.
#define SC_LIST_PROCS       8 // List all processes of the system.
#define SC_LIST_MOUNTS      9 // List all mountpoints of the system.
#define SC_UNAME           10 // Fetch basic system information.
#define SC_CHILD_MAX       11 // Maximum number of children for the user.
#define SC_LIST_THREADS    12 // List all threads of the system.
#define SC_LIST_CLUSTERS   13 // List all thread clusters of the system.
#define SC_LIST_NETINTER   14 // List all network interfaces.
#define SC_DUMPLOGS        15 // Dump kernel logging to a buffer.
#define SC_NGROUPS_MAX     16 // Max number of supplementary groups.
#define SC_SYMLOOP_MAX     17 // Max number of symbolic loops to follow.
#define SC_LIST_FILELOCKS  18 // List all advisory file locks.
#define SC_LOADAVG         19 // Dump load averages.
#define SC_MEMINFO         20 // Dump memory information.

long int sysconf(int request, uintptr_t addr, uintptr_t len);

This syscalls fetches the requested information in request and returns it.

Depending on the request, addr and len may be used for determining the address of a buffer and its length for reporting information that doesn’t fit on the usual return value. The options where they have meaning are:

The syscall return the requested information on success and -1 on failure. If the requested value can also be -1, errno must be checked.

The errno codes set on failure are: