Commit | Line | Data |
---|---|---|
74b98b46 KB |
1 | .\" Copyright (c) 1993 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" %sccs.include.redist.roff% | |
5 | .\" | |
6 | .\" @(#)sysconf.3 5.1 (Berkeley) %G% | |
7 | .\" | |
8 | .Dd | |
9 | .Dt SYSCONF 3 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm sysconf | |
13 | .Nd get configurable system variables | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <unistd.h> | |
16 | .Ft long | |
17 | .Fn sysconf "int name" | |
18 | .Sh DESCRIPTION | |
19 | .Bf -symbolic | |
20 | This interface is obsoleted by sysctl(3). | |
21 | .Ef | |
22 | .Pp | |
23 | The | |
24 | .Fn sysconf | |
25 | function provides a method for applications to determine the current | |
26 | value of a configurable system limit or option variable. | |
27 | The | |
28 | .Fa name | |
29 | argument specifies the system variable to be queried. | |
30 | Symbolic constants for each name value are found in the include file | |
31 | .Li <unistd.h> . | |
32 | .Pp | |
33 | The available values are as follows: | |
34 | .Pp | |
35 | .Bl -tag -width "123456" | |
36 | .Pp | |
37 | .It Li _SC_ARG_MAX | |
38 | The maximum bytes of argument to | |
39 | .Xr exec 2 . | |
40 | .It Li _SC_CHILD_MAX | |
41 | The maximum number of simultaneous processes per user id. | |
42 | .It Li _SC_CLK_TCK | |
43 | Number of micro-seconds per hz tick. | |
44 | .It Li _SC_NGROUPS_MAX | |
45 | The maximum number of supplemental groups. | |
46 | .It Li _SC_OPEN_MAX | |
47 | The maximum number of open files per user id. | |
48 | .It Li _SC_STREAM_MAX | |
49 | The minimum maximum number of streams that a process may have open | |
50 | at any one time. | |
51 | .It Li _SC_TZNAME_MAX | |
52 | The minimum maximum number of types supported for the name of a | |
53 | timezone. | |
54 | .It Li _SC_JOB_CONTROL | |
55 | Return 1 if job control is available on this system, otherwise \-1. | |
56 | .It Li _SC_SAVED_IDS | |
57 | Returns 1 if saved set-group and saved set-user ID is available, | |
58 | otherwise \-1. | |
59 | .It Li _SC_VERSION | |
60 | The version of ISO/IEC 9945 (POSIX 1003.1) with which the system | |
61 | attempts to comply. | |
62 | .It Li _SC_BC_BASE_MAX | |
63 | The maximum ibase/obase values in the | |
64 | .Xr bc 1 | |
65 | utility. | |
66 | .It Li _SC_BC_DIM_MAX | |
67 | The maximum array size in the | |
68 | .Xr bc 1 | |
69 | utility. | |
70 | .It Li _SC_BC_SCALE_MAX | |
71 | The maximum scale value in the | |
72 | .Xr bc 1 | |
73 | utility. | |
74 | .It Li _SC_BC_STRING_MAX | |
75 | The maximum string length in the | |
76 | .Xr bc 1 | |
77 | utility. | |
78 | .It Li _SC_COLL_WEIGHTS_MAX | |
79 | The maximum number of weights that can be assigned to any entry of | |
80 | the LC_COLLATE order keyword in the locale definition file. | |
81 | .It Li _SC_EXPR_NEST_MAX | |
82 | The maximum number of expressions that can be nested within | |
83 | parenthesis by the | |
84 | .Xr expr 1 | |
85 | utility. | |
86 | .It Li _SC_LINE_MAX | |
87 | The maximum length in bytes of a text-processing utility's input | |
88 | line. | |
89 | .It Li _SC_RE_DUP_MAX | |
90 | The maximum number of repeated occurrences of a regular expression | |
91 | permitted when using interval notation. | |
92 | .It Li _SC_2_VERSION | |
93 | The version of POSIX 1003.2 with which the system attempts to comply. | |
94 | .It Li _SC_2_C_BIND | |
95 | Return 1 if the system's C-language development facilities support the | |
96 | C-Language Bindings Option, otherwise \-1. | |
97 | .It Li _SC_2_C_DEV | |
98 | Return 1 if the system supports the C-Language Development Utilities Option, | |
99 | otherwise \-1. | |
100 | .It Li _SC_2_CHAR_TERM | |
101 | Return 1 if the system supports at least one terminal type capable of | |
102 | all operations described in POSIX 1003.2, otherwise \-1. | |
103 | .It Li _SC_2_FORT_DEV | |
104 | Return 1 if the system supports the FORTRAN Development Utilities Option, | |
105 | otherwise \-1. | |
106 | .It Li _SC_2_FORT_RUN | |
107 | Return 1 if the system supports the FORTRAN Runtime Utilities Option, | |
108 | otherwise \-1. | |
109 | .It Li _SC_2_LOCALEDEF | |
110 | Return 1 if the system supports the creation of locales, otherwise \-1. | |
111 | .It Li _SC_2_SW_DEV | |
112 | Return 1 if the system supports the Software Development Utilities Option, | |
113 | otherwise \-1. | |
114 | .It Li _SC_2_UPE | |
115 | Return 1 if the system supports the User Portability Utilities Option, | |
116 | otherwise \-1. | |
117 | .El | |
118 | .Sh RETURN VALUES | |
119 | If the call to | |
120 | .Nm sysconf | |
121 | is not successful, \-1 is returned and | |
122 | .Va errno | |
123 | is set appropriately. | |
124 | Otherwise, if the variable is associated with funtionality that is not | |
125 | supported, \-1 is returned and | |
126 | .Va errno | |
127 | is not modified. | |
128 | Otherwise, the current variable value is returned. | |
129 | .Sh ERRORS | |
130 | The | |
131 | .Fn sysconf | |
132 | function may fail and set | |
133 | .Va errno | |
134 | for any of the errors specified for the library functions | |
135 | .Xr sysctl 3 . | |
136 | In addition, the following errors may be reported: | |
137 | .Bl -tag -width Er | |
138 | .It Bq Er EINVAL | |
139 | The value of the | |
140 | .Fa name | |
141 | argument is invalid. | |
142 | .Sh SEE ALSO | |
143 | .Xr sysctl 3 | |
144 | .Sh HISTORY | |
145 | The | |
146 | .Nm sysconf | |
147 | function first appeared in 4.4BSD. | |
148 | .Sh BUGS | |
149 | The value for _SC_STREAM_MAX is a minimum maximum, and required to be | |
150 | the same as ANSI C's FOPEN_MAX, so the returned value is a ridiculously | |
151 | small and misleading number. |