1994-05-27 05:00:24 +00:00
|
|
|
.\" Copyright (c) 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)sysconf.3 8.3 (Berkeley) 4/19/94
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1994-05-27 05:00:24 +00:00
|
|
|
.\"
|
2001-06-18 22:18:08 +00:00
|
|
|
.Dd June 18, 2001
|
1994-05-27 05:00:24 +00:00
|
|
|
.Dt SYSCONF 3
|
2001-07-10 13:41:46 +00:00
|
|
|
.Os
|
1994-05-27 05:00:24 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm sysconf
|
|
|
|
.Nd get configurable system variables
|
2000-04-21 09:42:15 +00:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libc
|
1994-05-27 05:00:24 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In unistd.h
|
1994-05-27 05:00:24 +00:00
|
|
|
.Ft long
|
|
|
|
.Fn sysconf "int name"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
This interface is defined by
|
|
|
|
.St -p1003.1-88 .
|
|
|
|
A far more complete interface is available using
|
|
|
|
.Xr sysctl 3 .
|
|
|
|
.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
|
2003-09-08 19:57:22 +00:00
|
|
|
.In unistd.h .
|
2001-06-18 22:18:08 +00:00
|
|
|
Shell programmers who need access to these parameters should use the
|
|
|
|
.Xr getconf 1
|
|
|
|
utility.
|
1994-05-27 05:00:24 +00:00
|
|
|
.Pp
|
|
|
|
The available values are as follows:
|
|
|
|
.Pp
|
2000-12-29 14:08:20 +00:00
|
|
|
.Bl -tag -width 6n
|
1994-05-27 05:00:24 +00:00
|
|
|
.Pp
|
|
|
|
.It Li _SC_ARG_MAX
|
|
|
|
The maximum bytes of argument to
|
1996-02-15 20:07:05 +00:00
|
|
|
.Xr execve 2 .
|
2003-12-23 18:42:55 +00:00
|
|
|
.It Li _SC_CHILD_MAX
|
|
|
|
The maximum number of simultaneous processes per user id.
|
|
|
|
.It Li _SC_CLK_TCK
|
|
|
|
The frequency of the statistics clock in ticks per second.
|
|
|
|
.It Li _SC_IOV_MAX
|
|
|
|
The maximum number of elements in the I/O vector used by
|
|
|
|
.Xr readv 2 ,
|
|
|
|
.Xr writev 2 ,
|
|
|
|
.Xr recvmsg 2 ,
|
|
|
|
and
|
|
|
|
.Xr sendmsg 2 .
|
|
|
|
.It Li _SC_NGROUPS_MAX
|
|
|
|
The maximum number of supplemental groups.
|
|
|
|
.It Li _SC_NPROCESSORS_CONF
|
|
|
|
The number of processors configured.
|
|
|
|
.It Li _SC_NPROCESSORS_ONLN
|
|
|
|
The number of processors currently online.
|
|
|
|
.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,
|
1994-05-27 05:00:24 +00:00
|
|
|
otherwise \-1.
|
2003-12-23 18:42:55 +00:00
|
|
|
.It Li _SC_VERSION
|
|
|
|
The version of
|
|
|
|
.St -p1003.1
|
|
|
|
with which the system
|
|
|
|
attempts to comply.
|
1994-05-27 05:00:24 +00:00
|
|
|
.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.
|
2003-12-23 18:42:55 +00:00
|
|
|
.It Li _SC_2_VERSION
|
2003-12-23 17:29:35 +00:00
|
|
|
The version of
|
2003-12-23 18:42:55 +00:00
|
|
|
.St -p1003.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
|
|
|
|
.St -p1003.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.
|
1994-05-27 05:00:24 +00:00
|
|
|
.El
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
If the call to
|
1996-08-22 22:05:59 +00:00
|
|
|
.Fn sysconf
|
1994-05-27 05:00:24 +00:00
|
|
|
is not successful, \-1 is returned and
|
|
|
|
.Va errno
|
|
|
|
is set appropriately.
|
|
|
|
Otherwise, if the variable is associated with functionality 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
|
2001-06-18 22:18:08 +00:00
|
|
|
for any of the errors specified for the library function
|
1994-05-27 05:00:24 +00:00
|
|
|
.Xr sysctl 3 .
|
|
|
|
In addition, the following error may be reported:
|
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EINVAL
|
|
|
|
The value of the
|
|
|
|
.Fa name
|
|
|
|
argument is invalid.
|
2000-12-29 14:08:20 +00:00
|
|
|
.El
|
1994-05-27 05:00:24 +00:00
|
|
|
.Sh SEE ALSO
|
2001-06-18 22:18:08 +00:00
|
|
|
.Xr getconf 1 ,
|
|
|
|
.Xr pathconf 2 ,
|
|
|
|
.Xr confstr 3 ,
|
1994-05-27 05:00:24 +00:00
|
|
|
.Xr sysctl 3
|
|
|
|
.Sh STANDARDS
|
1996-12-27 03:39:03 +00:00
|
|
|
Except for the fact that values returned by
|
1994-05-27 05:00:24 +00:00
|
|
|
.Fn sysconf
|
1996-12-27 03:39:03 +00:00
|
|
|
may change over the lifetime of the calling process,
|
|
|
|
this function conforms to
|
1994-05-27 05:00:24 +00:00
|
|
|
.St -p1003.1-88 .
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1996-08-22 22:05:59 +00:00
|
|
|
.Fn sysconf
|
1996-08-22 23:31:07 +00:00
|
|
|
function first appeared in
|
|
|
|
.Bx 4.4 .
|
2005-01-20 09:17:07 +00:00
|
|
|
.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.
|