[BACK]Return to sysconf.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Annotation of src/lib/libc/gen/sysconf.3, Revision 1.23

1.23    ! wiz         1: .\"    $NetBSD: sysconf.3,v 1.22 2003/02/02 20:33:07 kleink Exp $
1.2       cgd         2: .\"
1.1       cgd         3: .\" Copyright (c) 1993
                      4: .\"    The Regents of the University of California.  All rights reserved.
                      5: .\"
                      6: .\" Redistribution and use in source and binary forms, with or without
                      7: .\" modification, are permitted provided that the following conditions
                      8: .\" are met:
                      9: .\" 1. Redistributions of source code must retain the above copyright
                     10: .\"    notice, this list of conditions and the following disclaimer.
                     11: .\" 2. Redistributions in binary form must reproduce the above copyright
                     12: .\"    notice, this list of conditions and the following disclaimer in the
                     13: .\"    documentation and/or other materials provided with the distribution.
                     14: .\" 3. All advertising materials mentioning features or use of this software
                     15: .\"    must display the following acknowledgement:
                     16: .\"    This product includes software developed by the University of
                     17: .\"    California, Berkeley and its contributors.
                     18: .\" 4. Neither the name of the University nor the names of its contributors
                     19: .\"    may be used to endorse or promote products derived from this software
                     20: .\"    without specific prior written permission.
                     21: .\"
                     22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32: .\" SUCH DAMAGE.
                     33: .\"
                     34: .\"    @(#)sysconf.3   8.3 (Berkeley) 4/19/94
                     35: .\"
1.22      kleink     36: .Dd February 2, 2003
1.1       cgd        37: .Dt SYSCONF 3
1.11      garbled    38: .Os
1.1       cgd        39: .Sh NAME
                     40: .Nm sysconf
                     41: .Nd get configurable system variables
1.6       perry      42: .Sh LIBRARY
                     43: .Lb libc
1.1       cgd        44: .Sh SYNOPSIS
1.19      ross       45: .Fd #include \*[Lt]unistd.h\*[Gt]
1.1       cgd        46: .Ft long
                     47: .Fn sysconf "int name"
                     48: .Sh DESCRIPTION
                     49: This interface is defined by
                     50: .St -p1003.1-88 .
                     51: A far more complete interface is available using
                     52: .Xr sysctl 3 .
                     53: .Pp
                     54: The
                     55: .Fn sysconf
                     56: function provides a method for applications to determine the current
                     57: value of a configurable system limit or option variable.
                     58: The
                     59: .Fa name
                     60: argument specifies the system variable to be queried.
                     61: Symbolic constants for each name value are found in the include file
1.19      ross       62: .Li \*[Lt]unistd.h\*[Gt] .
1.1       cgd        63: .Pp
                     64: The available values are as follows:
                     65: .Pp
                     66: .Bl -tag -width "123456"
                     67: .Pp
                     68: .It Li _SC_ARG_MAX
                     69: The maximum bytes of argument to
1.7       fair       70: .Xr execve 2 .
1.21      kleink     71: .It Li _SC_ATEXIT_MAX
                     72: The maxmimum number of functions that may be registered with
                     73: .Xr atexit 3 .
1.22      kleink     74: .It Li _SC_BARRIERS
                     75: The version of
1.23    ! wiz        76: .St -p1003.1
        !            77: and its
1.22      kleink     78: Barriers
                     79: option to which the system attempts to conform,
                     80: otherwise \-1.
1.1       cgd        81: .It Li _SC_CHILD_MAX
                     82: The maximum number of simultaneous processes per user id.
                     83: .It Li _SC_CLK_TCK
1.3       jtc        84: The number of clock ticks per second.
1.9       kleink     85: .It Li _SC_FSYNC
                     86: Return 1 if the File Synchronization Option is available on this system,
                     87: otherwise \-1.
                     88: .It Li _SC_IOV_MAX
                     89: The maximum number of
                     90: .Va iovec
                     91: structures that a process has available for use with
                     92: .Xr preadv 2 ,
                     93: .Xr pwritev 2 ,
                     94: .Xr readv 2 ,
                     95: .Xr recvmsg 2 ,
                     96: .Xr sendmsg 2
                     97: or
                     98: .Xr writev 2 .
                     99: .It Li _SC_JOB_CONTROL
                    100: Return 1 if job control is available on this system, otherwise \-1.
1.13      kleink    101: .It Li _SC_LOGIN_NAME_MAX
                    102: Returns the size of the storage required for a login name, in bytes,
                    103: including the terminating NUL.
1.12      kleink    104: .It Li _SC_MAPPED_FILES
                    105: Return 1 if the Memory Mapped Files Option is available on this system,
                    106: otherwise \-1.
                    107: .It Li _SC_MEMLOCK
                    108: Return 1 if the Process Memory Locking Option is available on this system,
                    109: otherwise \-1.
                    110: .It Li _SC_MEMLOCK_RANGE
                    111: Return 1 if the Range Memory Locking Option is available on this system,
                    112: otherwise \-1.
                    113: .It Li _SC_MEMORY_PROTECTION
                    114: Return 1 if the Memory Protection Option is available on this system,
                    115: otherwise \-1.
1.18      kleink    116: .It Li _SC_MONOTONIC_CLOCK
1.20      kleink    117: Return the
                    118: .Tn POSIX
                    119: version the implementation of the Monotonic Clock Option
                    120: on this system conforms to,
1.18      kleink    121: or \-1 if unavailable.
1.1       cgd       122: .It Li _SC_NGROUPS_MAX
                    123: The maximum number of supplemental groups.
                    124: .It Li _SC_OPEN_MAX
1.15      kleink    125: The maximum number of open files per process.
1.9       kleink    126: .It Li _SC_PAGESIZE
                    127: The size of a system page in bytes.
1.22      kleink    128: .It Li _SC_READER_WRITER_LOCKS
                    129: The version of
1.23    ! wiz       130: .St -p1003.1
        !           131: and its
1.22      kleink    132: Read-Write Locks
                    133: option to which the system attempts to conform,
                    134: otherwise \-1.
                    135: .It Li _SC_SEMAPHORES
                    136: The version of
1.23    ! wiz       137: .St -p1003.1
        !           138: and its
1.22      kleink    139: Semaphores
                    140: option to which the system attempts to conform,
                    141: otherwise \-1.
                    142: .It Li _SC_SPIN_LOCKS
                    143: The version of
1.23    ! wiz       144: .St -p1003.1
        !           145: and its
1.22      kleink    146: Spin Locks
                    147: option to which the system attempts to conform,
                    148: otherwise \-1.
1.1       cgd       149: .It Li _SC_STREAM_MAX
                    150: The minimum maximum number of streams that a process may have open
                    151: at any one time.
1.9       kleink    152: .It Li _SC_SYNCHRONIZED_IO
                    153: Return 1 if the Synchronized I/O Option is available on this system,
1.22      kleink    154: otherwise \-1.
                    155: .It Li _SC_THREADS
                    156: The version of
1.23    ! wiz       157: .St -p1003.1
        !           158: and its
1.22      kleink    159: Threads
                    160: option to which the system attempts to conform,
                    161: otherwise \-1.
                    162: .It Li _SC_TIMERS
                    163: The version of
1.23    ! wiz       164: .St -p1003.1
        !           165: and its
1.22      kleink    166: Timers
                    167: option to which the system attempts to conform,
1.9       kleink    168: otherwise \-1.
1.1       cgd       169: .It Li _SC_TZNAME_MAX
                    170: The minimum maximum number of types supported for the name of a
                    171: timezone.
                    172: .It Li _SC_SAVED_IDS
                    173: Returns 1 if saved set-group and saved set-user ID is available,
                    174: otherwise \-1.
                    175: .It Li _SC_VERSION
                    176: The version of ISO/IEC 9945 (POSIX 1003.1) with which the system
                    177: attempts to comply.
1.14      kleink    178: .It Li _SC_XOPEN_SHM
                    179: Return 1 of the system supports System V style shared memory,
                    180: otherwise \-1.
1.1       cgd       181: .It Li _SC_BC_BASE_MAX
                    182: The maximum ibase/obase values in the
                    183: .Xr bc 1
                    184: utility.
                    185: .It Li _SC_BC_DIM_MAX
                    186: The maximum array size in the
                    187: .Xr bc 1
                    188: utility.
                    189: .It Li _SC_BC_SCALE_MAX
                    190: The maximum scale value in the
                    191: .Xr bc 1
                    192: utility.
                    193: .It Li _SC_BC_STRING_MAX
                    194: The maximum string length in the
                    195: .Xr bc 1
                    196: utility.
                    197: .It Li _SC_COLL_WEIGHTS_MAX
                    198: The maximum number of weights that can be assigned to any entry of
                    199: the LC_COLLATE order keyword in the locale definition file.
                    200: .It Li _SC_EXPR_NEST_MAX
                    201: The maximum number of expressions that can be nested within
                    202: parenthesis by the
                    203: .Xr expr 1
                    204: utility.
                    205: .It Li _SC_LINE_MAX
                    206: The maximum length in bytes of a text-processing utility's input
                    207: line.
                    208: .It Li _SC_RE_DUP_MAX
                    209: The maximum number of repeated occurrences of a regular expression
                    210: permitted when using interval notation.
                    211: .It Li _SC_2_VERSION
                    212: The version of POSIX 1003.2 with which the system attempts to comply.
1.16      wiz       213: .It Li _SC_2_C_BIND
1.1       cgd       214: Return 1 if the system's C-language development facilities support the
                    215: C-Language Bindings Option, otherwise \-1.
                    216: .It Li _SC_2_C_DEV
                    217: Return 1 if the system supports the C-Language Development Utilities Option,
                    218: otherwise \-1.
                    219: .It Li _SC_2_CHAR_TERM
                    220: Return 1 if the system supports at least one terminal type capable of
                    221: all operations described in POSIX 1003.2, otherwise \-1.
                    222: .It Li _SC_2_FORT_DEV
                    223: Return 1 if the system supports the FORTRAN Development Utilities Option,
                    224: otherwise \-1.
                    225: .It Li _SC_2_FORT_RUN
                    226: Return 1 if the system supports the FORTRAN Runtime Utilities Option,
                    227: otherwise \-1.
                    228: .It Li _SC_2_LOCALEDEF
                    229: Return 1 if the system supports the creation of locales, otherwise \-1.
                    230: .It Li _SC_2_SW_DEV
                    231: Return 1 if the system supports the Software Development Utilities Option,
                    232: otherwise \-1.
                    233: .It Li _SC_2_UPE
                    234: Return 1 if the system supports the User Portability Utilities Option,
1.9       kleink    235: otherwise \-1.
1.1       cgd       236: .El
                    237: .Sh RETURN VALUES
                    238: If the call to
                    239: .Nm sysconf
                    240: is not successful, \-1 is returned and
                    241: .Va errno
                    242: is set appropriately.
                    243: Otherwise, if the variable is associated with functionality that is not
                    244: supported, \-1 is returned and
                    245: .Va errno
                    246: is not modified.
                    247: Otherwise, the current variable value is returned.
                    248: .Sh ERRORS
                    249: The
                    250: .Fn sysconf
                    251: function may fail and set
                    252: .Va errno
                    253: for any of the errors specified for the library functions
                    254: .Xr sysctl 3 .
                    255: In addition, the following error may be reported:
                    256: .Bl -tag -width Er
                    257: .It Bq Er EINVAL
                    258: The value of the
                    259: .Fa name
                    260: argument is invalid.
1.10      erh       261: .El
1.1       cgd       262: .Sh SEE ALSO
                    263: .Xr sysctl 3
                    264: .Sh STANDARDS
                    265: The
                    266: .Fn sysconf
                    267: function conforms to
1.4       kleink    268: .St -p1003.1-90 .
1.1       cgd       269: .Sh HISTORY
                    270: The
                    271: .Nm sysconf
1.5       perry     272: function first appeared in
                    273: .Bx 4.4 .
1.17      wiz       274: .Sh BUGS
                    275: The value for _SC_STREAM_MAX is a minimum maximum, and required to be
                    276: the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously
                    277: small and misleading number.

CVSweb <webmaster@jp.NetBSD.org>