📄 sysconf.3
字号:
.\" 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.\".Dd April 19, 1994.Dt SYSCONF 3.Os BSD 4.Sh NAME.Nm sysconf.Nd get configurable system variables.Sh SYNOPSIS.Fd #include <unistd.h>.Ft long.Fn sysconf "int name".Sh DESCRIPTION.PpThis interface is defined by.St -p1003.1-88 .A far more complete interface is available using.Xr sysctl 3 ..PpThe.Fn sysconffunction provides a method for applications to determine the currentvalue of a configurable system limit or option variable.The.Fa nameargument specifies the system variable to be queried.Symbolic constants for each name value are found in the include file.Li <unistd.h> ..PpThe available values are as follows:.Pp.Bl -tag -width "123456".Pp.It Li _SC_ARG_MAXThe maximum bytes of argument to.Xr exec 2 ..It Li _SC_CHILD_MAXThe maximum number of simultaneous processes per user id..It Li _SC_CLK_TCKNumber of micro-seconds per hz tick..It Li _SC_NGROUPS_MAXThe maximum number of supplemental groups..It Li _SC_OPEN_MAXThe maximum number of open files per user id..It Li _SC_STREAM_MAXThe minimum maximum number of streams that a process may have openat any one time..It Li _SC_TZNAME_MAXThe minimum maximum number of types supported for the name of atimezone..It Li _SC_JOB_CONTROLReturn 1 if job control is available on this system, otherwise \-1..It Li _SC_SAVED_IDSReturns 1 if saved set-group and saved set-user ID is available,otherwise \-1..It Li _SC_VERSIONThe version of ISO/IEC 9945 (POSIX 1003.1) with which the systemattempts to comply..It Li _SC_BC_BASE_MAXThe maximum ibase/obase values in the.Xr bc 1utility..It Li _SC_BC_DIM_MAXThe maximum array size in the.Xr bc 1utility..It Li _SC_BC_SCALE_MAXThe maximum scale value in the.Xr bc 1utility..It Li _SC_BC_STRING_MAXThe maximum string length in the.Xr bc 1utility..It Li _SC_COLL_WEIGHTS_MAXThe maximum number of weights that can be assigned to any entry ofthe LC_COLLATE order keyword in the locale definition file..It Li _SC_EXPR_NEST_MAXThe maximum number of expressions that can be nested withinparenthesis by the.Xr expr 1utility..It Li _SC_LINE_MAXThe maximum length in bytes of a text-processing utility's inputline..It Li _SC_RE_DUP_MAXThe maximum number of repeated occurrences of a regular expressionpermitted when using interval notation..It Li _SC_2_VERSIONThe 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 theC-Language Bindings Option, otherwise \-1..It Li _SC_2_C_DEVReturn 1 if the system supports the C-Language Development Utilities Option,otherwise \-1..It Li _SC_2_CHAR_TERMReturn 1 if the system supports at least one terminal type capable ofall operations described in POSIX 1003.2, otherwise \-1..It Li _SC_2_FORT_DEVReturn 1 if the system supports the FORTRAN Development Utilities Option,otherwise \-1..It Li _SC_2_FORT_RUNReturn 1 if the system supports the FORTRAN Runtime Utilities Option,otherwise \-1..It Li _SC_2_LOCALEDEFReturn 1 if the system supports the creation of locales, otherwise \-1..It Li _SC_2_SW_DEVReturn 1 if the system supports the Software Development Utilities Option,otherwise \-1..It Li _SC_2_UPEReturn 1 if the system supports the User Portability Utilities Option,otherwise \-1..El.Sh RETURN VALUESIf the call to.Nm sysconfis not successful, \-1 is returned and.Va errnois set appropriately.Otherwise, if the variable is associated with functionality that is notsupported, \-1 is returned and.Va errnois not modified.Otherwise, the current variable value is returned..Sh ERRORSThe.Fn sysconffunction may fail and set.Va errnofor any of the errors specified for the library functions.Xr sysctl 3 .In addition, the following error may be reported:.Bl -tag -width Er.It Bq Er EINVALThe value of the.Fa nameargument is invalid..Sh SEE ALSO.Xr sysctl 3.Sh BUGSThe value for _SC_STREAM_MAX is a minimum maximum, and required to bethe same as ANSI C's FOPEN_MAX, so the returned value is a ridiculouslysmall and misleading number..Sh STANDARDSThe.Fn sysconffunction conforms to.St -p1003.1-88 ..Sh HISTORYThe.Nm sysconffunction first appeared in 4.4BSD.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -