xref: /csrg-svn/lib/libc/gen/sysconf.3 (revision 66958)
163773Sbostic.\" Copyright (c) 1993
263773Sbostic.\"	The Regents of the University of California.  All rights reserved.
360275Sbostic.\"
460275Sbostic.\" %sccs.include.redist.roff%
560275Sbostic.\"
6*66958Sbostic.\"	@(#)sysconf.3	8.3 (Berkeley) 04/19/94
760275Sbostic.\"
860275Sbostic.Dd
960275Sbostic.Dt SYSCONF 3
1060275Sbostic.Os BSD 4
1160275Sbostic.Sh NAME
1260275Sbostic.Nm sysconf
1360275Sbostic.Nd get configurable system variables
1460275Sbostic.Sh SYNOPSIS
1560275Sbostic.Fd #include <unistd.h>
1660275Sbostic.Ft long
1760275Sbostic.Fn sysconf "int name"
1860275Sbostic.Sh DESCRIPTION
1960275Sbostic.Pp
2063772SmckusickThis interface is defined by
2163772Smckusick.St -p1003.1-88 .
2263772SmckusickA far more complete interface is available using
2363772Smckusick.Xr sysctl 3 .
2463772Smckusick.Pp
2560275SbosticThe
2660275Sbostic.Fn sysconf
2760275Sbosticfunction provides a method for applications to determine the current
2860275Sbosticvalue of a configurable system limit or option variable.
2960275SbosticThe
3060275Sbostic.Fa name
3160275Sbosticargument specifies the system variable to be queried.
3260275SbosticSymbolic constants for each name value are found in the include file
3360275Sbostic.Li <unistd.h> .
3460275Sbostic.Pp
3560275SbosticThe available values are as follows:
3660275Sbostic.Pp
3760275Sbostic.Bl -tag -width "123456"
3860275Sbostic.Pp
3960275Sbostic.It Li _SC_ARG_MAX
4060275SbosticThe maximum bytes of argument to
4160275Sbostic.Xr exec 2 .
4260275Sbostic.It Li _SC_CHILD_MAX
4360275SbosticThe maximum number of simultaneous processes per user id.
4460275Sbostic.It Li _SC_CLK_TCK
4560275SbosticNumber of micro-seconds per hz tick.
4660275Sbostic.It Li _SC_NGROUPS_MAX
4760275SbosticThe maximum number of supplemental groups.
4860275Sbostic.It Li _SC_OPEN_MAX
4960275SbosticThe maximum number of open files per user id.
5060275Sbostic.It Li _SC_STREAM_MAX
5160275SbosticThe minimum maximum number of streams that a process may have open
5260275Sbosticat any one time.
5360275Sbostic.It Li _SC_TZNAME_MAX
5460275SbosticThe minimum maximum number of types supported for the name of a
5560275Sbostictimezone.
5660275Sbostic.It Li _SC_JOB_CONTROL
5760275SbosticReturn 1 if job control is available on this system, otherwise \-1.
5860275Sbostic.It Li _SC_SAVED_IDS
5960275SbosticReturns 1 if saved set-group and saved set-user ID is available,
6060275Sbosticotherwise \-1.
6160275Sbostic.It Li _SC_VERSION
6260275SbosticThe version of ISO/IEC 9945 (POSIX 1003.1) with which the system
6360275Sbosticattempts to comply.
6460275Sbostic.It Li _SC_BC_BASE_MAX
6560275SbosticThe maximum ibase/obase values in the
6660275Sbostic.Xr bc 1
6760275Sbosticutility.
6860275Sbostic.It Li _SC_BC_DIM_MAX
6960275SbosticThe maximum array size in the
7060275Sbostic.Xr bc 1
7160275Sbosticutility.
7260275Sbostic.It Li _SC_BC_SCALE_MAX
7360275SbosticThe maximum scale value in the
7460275Sbostic.Xr bc 1
7560275Sbosticutility.
7660275Sbostic.It Li _SC_BC_STRING_MAX
7760275SbosticThe maximum string length in the
7860275Sbostic.Xr bc 1
7960275Sbosticutility.
8060275Sbostic.It Li _SC_COLL_WEIGHTS_MAX
8160275SbosticThe maximum number of weights that can be assigned to any entry of
8260275Sbosticthe LC_COLLATE order keyword in the locale definition file.
8360275Sbostic.It Li _SC_EXPR_NEST_MAX
8460275SbosticThe maximum number of expressions that can be nested within
8560275Sbosticparenthesis by the
8660275Sbostic.Xr expr 1
8760275Sbosticutility.
8860275Sbostic.It Li _SC_LINE_MAX
8960275SbosticThe maximum length in bytes of a text-processing utility's input
9060275Sbosticline.
9160275Sbostic.It Li _SC_RE_DUP_MAX
9260275SbosticThe maximum number of repeated occurrences of a regular expression
9360275Sbosticpermitted when using interval notation.
9460275Sbostic.It Li _SC_2_VERSION
9560275SbosticThe version of POSIX 1003.2 with which the system attempts to comply.
9660275Sbostic.It Li _SC_2_C_BIND
9760275SbosticReturn 1 if the system's C-language development facilities support the
9860275SbosticC-Language Bindings Option, otherwise \-1.
9960275Sbostic.It Li _SC_2_C_DEV
10060275SbosticReturn 1 if the system supports the C-Language Development Utilities Option,
10160275Sbosticotherwise \-1.
10260275Sbostic.It Li _SC_2_CHAR_TERM
10360275SbosticReturn 1 if the system supports at least one terminal type capable of
10460275Sbosticall operations described in POSIX 1003.2, otherwise \-1.
10560275Sbostic.It Li _SC_2_FORT_DEV
10660275SbosticReturn 1 if the system supports the FORTRAN Development Utilities Option,
10760275Sbosticotherwise \-1.
10860275Sbostic.It Li _SC_2_FORT_RUN
10960275SbosticReturn 1 if the system supports the FORTRAN Runtime Utilities Option,
11060275Sbosticotherwise \-1.
11160275Sbostic.It Li _SC_2_LOCALEDEF
11260275SbosticReturn 1 if the system supports the creation of locales, otherwise \-1.
11360275Sbostic.It Li _SC_2_SW_DEV
11460275SbosticReturn 1 if the system supports the Software Development Utilities Option,
11560275Sbosticotherwise \-1.
11660275Sbostic.It Li _SC_2_UPE
11760275SbosticReturn 1 if the system supports the User Portability Utilities Option,
11860275Sbosticotherwise \-1.
11960275Sbostic.El
12060275Sbostic.Sh RETURN VALUES
12160275SbosticIf the call to
12260275Sbostic.Nm sysconf
12360275Sbosticis not successful, \-1 is returned and
12460275Sbostic.Va errno
12560275Sbosticis set appropriately.
126*66958SbosticOtherwise, if the variable is associated with functionality that is not
12760275Sbosticsupported, \-1 is returned and
12860275Sbostic.Va errno
12960275Sbosticis not modified.
13060275SbosticOtherwise, the current variable value is returned.
13160275Sbostic.Sh ERRORS
13260275SbosticThe
13360275Sbostic.Fn sysconf
13460275Sbosticfunction may fail and set
13560275Sbostic.Va errno
13660275Sbosticfor any of the errors specified for the library functions
13760275Sbostic.Xr sysctl 3 .
13865099SmckusickIn addition, the following error may be reported:
13960275Sbostic.Bl -tag -width Er
14060275Sbostic.It Bq Er EINVAL
14160275SbosticThe value of the
14260275Sbostic.Fa name
14360275Sbosticargument is invalid.
14460275Sbostic.Sh SEE ALSO
14560275Sbostic.Xr sysctl 3
14663772Smckusick.Sh BUGS
14763772SmckusickThe value for _SC_STREAM_MAX is a minimum maximum, and required to be
14863772Smckusickthe same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously
14963772Smckusicksmall and misleading number.
15063772Smckusick.Sh STANDARDS
15163772SmckusickThe
15263772Smckusick.Fn sysconf
15363772Smckusickfunction conforms to
15463772Smckusick.St -p1003.1-88 .
15560275Sbostic.Sh HISTORY
15660275SbosticThe
15760275Sbostic.Nm sysconf
15860275Sbosticfunction first appeared in 4.4BSD.
159