---
name: "sysconf"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/sysconf/3"
---

# sysconf(3)

get configurable system variables

## NAME

**sysconf** – get configurable system variables

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<unistd.h\>**

*long*\

**sysconf**(*int name*);

## DESCRIPTION

This interface is defined by IEEE Std 1003.1-1988 (“POSIX.1”). A far more complete interface is available using [sysctl(3)](/sysctl/3.md).

The **sysconf**() function provides a method for applications to determine the current value of a configurable system limit or option variable. The *name* argument specifies the system variable to be queried. Symbolic constants for each name value are found in the include file ⟨unistd.h⟩. Shell programmers who need access to these parameters should use the [getconf(1)](/getconf/1.md) utility.

The available values are as follows:

- \_SC\_ARG\_MAX

  The maximum bytes of argument to [execve(2)](/execve/2.md).

- \_SC\_CHILD\_MAX

  The maximum number of simultaneous processes per user id.

- \_SC\_CLK\_TCK

  The frequency of the statistics clock in ticks per second.

- \_SC\_IOV\_MAX

  The maximum number of elements in the I/O vector used by [readv(2)](/readv/2.md), [writev(2)](/writev/2.md), [recvmsg(2)](/recvmsg/2.md), and [sendmsg(2)](/sendmsg/2.md).

- \_SC\_NGROUPS\_MAX

  The maximum number of supplemental groups.

- \_SC\_NPROCESSORS\_CONF

  The number of processors configured.

- \_SC\_NPROCESSORS\_ONLN

  The number of processors currently online, taking into account current jail restrictions to report only the number of processors that are usable to the process.

- \_SC\_OPEN\_MAX

  One more than the maximum value the system may assign to a new file descriptor.

- \_SC\_PAGESIZE

  The size of a system page in bytes.

- \_SC\_PAGE\_SIZE

  Equivalent to \_SC\_PAGESIZE.

- \_SC\_STREAM\_MAX

  The minimum maximum number of streams that a process may have open at any one time.

- \_SC\_TZNAME\_MAX

  The minimum maximum number of types supported for the name of a timezone.

- \_SC\_JOB\_CONTROL

  Return 1 if job control is available on this system, otherwise -1.

- \_SC\_SAVED\_IDS

  Returns 1 if saved set-group and saved set-user ID is available, otherwise -1.

- \_SC\_VERSION

  The version of IEEE Std 1003.1 (“POSIX.1”) with which the system attempts to comply.

- \_SC\_BC\_BASE\_MAX

  The maximum ibase/obase values in the [bc(1)](/bc/1.md) utility.

- \_SC\_BC\_DIM\_MAX

  The maximum array size in the [bc(1)](/bc/1.md) utility.

- \_SC\_BC\_SCALE\_MAX

  The maximum scale value in the [bc(1)](/bc/1.md) utility.

- \_SC\_BC\_STRING\_MAX

  The maximum string length in the [bc(1)](/bc/1.md) utility.

- \_SC\_COLL\_WEIGHTS\_MAX

  The maximum number of weights that can be assigned to any entry of the LC\_COLLATE order keyword in the locale definition file.

- \_SC\_EXPR\_NEST\_MAX

  The maximum number of expressions that can be nested within parenthesis by the [expr(1)](/expr/1.md) utility.

- \_SC\_LINE\_MAX

  The maximum length in bytes of a text-processing utility's input line.

- \_SC\_RE\_DUP\_MAX

  The maximum number of repeated occurrences of a regular expression permitted when using interval notation.

- \_SC\_2\_VERSION

  The version of IEEE Std 1003.2 (“POSIX.2”) with which the system attempts to comply.

- \_SC\_2\_C\_BIND

  Return 1 if the system's C-language development facilities support the C-Language Bindings Option, otherwise -1.

- \_SC\_2\_C\_DEV

  Return 1 if the system supports the C-Language Development Utilities Option, otherwise -1.

- \_SC\_2\_CHAR\_TERM

  Return 1 if the system supports at least one terminal type capable of all operations described in IEEE Std 1003.2 (“POSIX.2”), otherwise -1.

- \_SC\_2\_FORT\_DEV

  Return 1 if the system supports the FORTRAN Development Utilities Option, otherwise -1.

- \_SC\_2\_FORT\_RUN

  Return 1 if the system supports the FORTRAN Runtime Utilities Option, otherwise -1.

- \_SC\_2\_LOCALEDEF

  Return 1 if the system supports the creation of locales, otherwise -1.

- \_SC\_2\_SW\_DEV

  Return 1 if the system supports the Software Development Utilities Option, otherwise -1.

- \_SC\_2\_UPE

  Return 1 if the system supports the User Portability Utilities Option, otherwise -1.

- \_SC\_AIO\_LISTIO\_MAX

  Maximum number of I/O operations in a single list I/O call supported.

- \_SC\_AIO\_MAX

  Maximum number of outstanding asynchronous I/O operations supported.

- \_SC\_AIO\_PRIO\_DELTA\_MAX

  The maximum amount by which a process can decrease its asynchronous I/O priority level from its own scheduling priority.

- \_SC\_DELAYTIMER\_MAX

  Maximum number of timer expiration overruns.

- \_SC\_MQ\_OPEN\_MAX

  The maximum number of open message queue descriptors a process may hold.

- \_SC\_RTSIG\_MAX

  Maximum number of realtime signals reserved for application use.

- \_SC\_SEM\_NSEMS\_MAX

  Maximum number of semaphores that a process may have.

- \_SC\_SEM\_VALUE\_MAX

  The maximum value a semaphore may have.

- \_SC\_SIGQUEUE\_MAX

  Maximum number of queued signals that a process may send and have pending at the receiver(s) at any time.

- \_SC\_TIMER\_MAX

  Maximum number of timers per process supported.

- \_SC\_GETGR\_R\_SIZE\_MAX

  Suggested initial value for the size of the group entry buffer.

- \_SC\_GETPW\_R\_SIZE\_MAX

  Suggested initial value for the size of the password entry buffer.

- \_SC\_HOST\_NAME\_MAX

  Maximum length of a host name (not including the terminating null) as returned from the **gethostname**() function.

- \_SC\_LOGIN\_NAME\_MAX

  Maximum length of a login name.

- \_SC\_THREAD\_STACK\_MIN

  Minimum size in bytes of thread stack storage.

- \_SC\_THREAD\_THREADS\_MAX

  Maximum number of threads that can be created per process.

- \_SC\_TTY\_NAME\_MAX

  Maximum length of terminal device name.

- \_SC\_SYMLOOP\_MAX

  Maximum number of symbolic links that can be reliably traversed in the resolution of a pathname in the absence of a loop.

- \_SC\_ATEXIT\_MAX

  Maximum number of functions that may be registered with **atexit**().

- \_SC\_XOPEN\_VERSION

  An integer value greater than or equal to 4, indicating the version of the X/Open Portability Guide to which this system conforms.

- \_SC\_XOPEN\_XCU\_VERSION

  An integer value indicating the version of the XCU Specification to which this system conforms.

These values also exist, but may not be standard:

- \_SC\_CPUSET\_SIZE

  Size of the kernel cpuset.

- \_SC\_PHYS\_PAGES

  The number of pages of physical memory. Note that it is possible that the product of this value and the value of \_SC\_PAGESIZE will overflow a *long* in some configurations on a 32bit machine.

## RETURN VALUES

If the call to **sysconf**() is not successful, -1 is returned and *errno* is set appropriately. Otherwise, if the variable is associated with functionality that is not supported, -1 is returned and *errno* is not modified. Otherwise, the current variable value is returned.

## ERRORS

The **sysconf**() function may fail and set *errno* for any of the errors specified for the library function [sysctl(3)](/sysctl/3.md). In addition, the following error may be reported:

- \[EINVAL\]

  The value of the *name* argument is invalid.

## SEE ALSO

[getconf(1)](/getconf/1.md), [pathconf(2)](/pathconf/2.md), [confstr(3)](/confstr/3.md), [sysctl(3)](/sysctl/3.md)

## STANDARDS

Except for the fact that values returned by **sysconf**() may change over the lifetime of the calling process, this function conforms to IEEE Std 1003.1-1988 (“POSIX.1”).

## HISTORY

The **sysconf**() function first appeared in 4.4BSD.

## BUGS

The value for \_SC\_STREAM\_MAX is a minimum maximum, and required to be the same as ANSI C's FOPEN\_MAX, so the returned value is a ridiculously small and misleading number.
