.\" Copyright (c) 1993 The Regents of the University of California. .\" All rights reserved. .\" .\" %sccs.include.redist.roff% .\" .\" @(#)sysconf.3 5.1 (Berkeley) 05/24/93 .\" .Dd .Dt SYSCONF 3 .Os BSD 4 .Sh NAME .Nm sysconf .Nd get configurable system variables .Sh SYNOPSIS .Fd #include .Ft long .Fn sysconf "int name" .Sh DESCRIPTION .Bf -symbolic This interface is obsoleted by sysctl(3). .Ef .Pp The .Fn sysconf function provides a method for applications to determine the current value of a configurable system limit or option variable. The .Fa name argument specifies the system variable to be queried. Symbolic constants for each name value are found in the include file .Li . .Pp The available values are as follows: .Pp .Bl -tag -width "123456" .Pp .It Li _SC_ARG_MAX The maximum bytes of argument to .Xr exec 2 . .It Li _SC_CHILD_MAX The maximum number of simultaneous processes per user id. .It Li _SC_CLK_TCK Number of micro-seconds per hz tick. .It Li _SC_NGROUPS_MAX The maximum number of supplemental groups. .It Li _SC_OPEN_MAX The maximum number of open files per user id. .It Li _SC_STREAM_MAX The minimum maximum number of streams that a process may have open at any one time. .It Li _SC_TZNAME_MAX The minimum maximum number of types supported for the name of a timezone. .It Li _SC_JOB_CONTROL Return 1 if job control is available on this system, otherwise \-1. .It Li _SC_SAVED_IDS Returns 1 if saved set-group and saved set-user ID is available, otherwise \-1. .It Li _SC_VERSION The version of ISO/IEC 9945 (POSIX 1003.1) with which the system attempts to comply. .It Li _SC_BC_BASE_MAX The maximum ibase/obase values in the .Xr bc 1 utility. .It Li _SC_BC_DIM_MAX The maximum array size in the .Xr bc 1 utility. .It Li _SC_BC_SCALE_MAX The maximum scale value in the .Xr bc 1 utility. .It Li _SC_BC_STRING_MAX The maximum string length in the .Xr bc 1 utility. .It Li _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. .It Li _SC_EXPR_NEST_MAX The maximum number of expressions that can be nested within parenthesis by the .Xr expr 1 utility. .It Li _SC_LINE_MAX The maximum length in bytes of a text-processing utility's input line. .It Li _SC_RE_DUP_MAX The maximum number of repeated occurrences of a regular expression permitted when using interval notation. .It Li _SC_2_VERSION The version of POSIX 1003.2 with which the system attempts to comply. .It Li _SC_2_C_BIND Return 1 if the system's C-language development facilities support the C-Language Bindings Option, otherwise \-1. .It Li _SC_2_C_DEV Return 1 if the system supports the C-Language Development Utilities Option, otherwise \-1. .It Li _SC_2_CHAR_TERM Return 1 if the system supports at least one terminal type capable of all operations described in POSIX 1003.2, otherwise \-1. .It Li _SC_2_FORT_DEV Return 1 if the system supports the FORTRAN Development Utilities Option, otherwise \-1. .It Li _SC_2_FORT_RUN Return 1 if the system supports the FORTRAN Runtime Utilities Option, otherwise \-1. .It Li _SC_2_LOCALEDEF Return 1 if the system supports the creation of locales, otherwise \-1. .It Li _SC_2_SW_DEV Return 1 if the system supports the Software Development Utilities Option, otherwise \-1. .It Li _SC_2_UPE Return 1 if the system supports the User Portability Utilities Option, otherwise \-1. .El .Sh RETURN VALUES If the call to .Nm sysconf is not successful, \-1 is returned and .Va errno is set appropriately. Otherwise, if the variable is associated with funtionality that is not supported, \-1 is returned and .Va errno is not modified. Otherwise, the current variable value is returned. .Sh ERRORS The .Fn sysconf function may fail and set .Va errno for any of the errors specified for the library functions .Xr sysctl 3 . In addition, the following errors may be reported: .Bl -tag -width Er .It Bq Er EINVAL The value of the .Fa name argument is invalid. .Sh SEE ALSO .Xr sysctl 3 .Sh HISTORY The .Nm sysconf function first appeared in 4.4BSD. .Sh 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.