File: sysconf.3

package info (click to toggle)
manpages 1.19-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 3,668 kB
  • ctags: 4
  • sloc: sh: 87; makefile: 53
file content (213 lines) | stat: -rw-r--r-- 6,116 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
.\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\" License.
.\" Modified Sat Jul 24 17:51:42 1993 by Rik Faith (faith@cs.unc.edu)
.TH SYSCONF 3  "April 18, 1993" "GNU" "Linux Programmer's Manual"
.SH NAME
sysconf \- Get configuration information at runtime
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.sp
.BI "long sysconf(int " "name" ");"
.fi
.SH DESCRIPTION
.B sysconf()
provides a way for the application to determine values for system
limits or options at runtime.
.PP
The equivalent macros defined in
.B <unistd.h>
can only give conservative values; if an application wants to take
advantage of values which may change, a call to
.B sysconf()
can be made, which may yield more liberal results.
.PP
For getting information about a particular file, see
.BR fpathconf() " or " pathconf() .
.PP
The following values are supported for
.IR name .
First, the POSIX.1 compatible values:
.TP
.B _SC_ARG_MAX
The maximum length of the arguments to the
.B exec()
family of functions; the corresponding macro is
.BR ARG_MAX .
.TP
.B _SC_CHILD_MAX
The number of simultaneous processes per user id, the corresponding macro
is
.BR _POSIX_CHILD_MAX .
.TP
.B _SC_CLK_TCK
The number of clock ticks per second; the corresponding macro is
.BR CLK_TCK .
.TP
.B _SC_STREAM_MAX
The maximum number of streams that a process can have open at any
time.
The corresponding POSIX macro is
.BR STREAM_MAX ,
the corresponding standard C macro is
.BR FOPEN_MAX .
.TP
.B _SC_TZNAME_MAX
The maximum number of bytes in a timezone name, the corresponding macro
is
.BR TZNAME_MAX .
.TP
.B _SC_OPEN_MAX
The maximum number of files that a process can have open at any time,
the corresponding macro is
.BR _POSIX_OPEN_MAX .
.TP
.B _SC_JOB_CONTROL
This indicates whether POSIX \- style job control is supported, the
corresponding macro is
.BR _POSIX_JOB_CONTROL .
.TP
.B _SC_SAVED_IDS
This indicates whether a process has a saved set-user-ID and a saved
set-group-ID; the corresponding macro is
.BR _POSIX_SAVED_IDS .
.TP
.B _SC_VERSION
indicates the year and month the POSIX.1 standard was approved in the
format
.BR YYYYMML ; the
value
.B 199009L
indicates the most recent revision, 1990.
.PP
Next, the POSIX.2 values:
.TP
.B _SC_BC_BASE_MAX
indicates the maximum
.I obase
value accepted by the
.BR bc (1)
utility; the corresponding macro is
.BR BC_BASE_MAX .
.TP
.B _SC_BC_DIM_MAX
indicates the maximum value of elements permitted in an array by
.BR bc (1);
the corresponding macro is
.BR BC_DIM_MAX . 
.TP
.B _SC_BC_SCALE_MAX
indicates the maximum
.I scale
value allowed by
.BR bc (1);
the corresponding macro is
.BR BC_SCALE_MAX .
.TP
.B _SC_BC_STRING_MAX
indicates the maximum length of a string accepted by
.BR bc (1);
the corresponding macro is
.BR BC_STRING_MAX .
.TP
.B _SC_COLL_WEIGHTS_MAX
indicates the maximum numbers of weights that can be assigned to an
entry of the
.B LC_COLLATE order
keyword in the locale definition file; the corresponding macro is
.BR COLL_WEIGHTS_MAX .
.TP
.B _SC_EXPR_NEST_MAX
is the maximum number of expressions which can be nested within
parentheses by
.BR expr (1).
The corresponding macro is
.BR EXPR_NEST_MAX .
.TP
.B _SC_LINE_MAX
The maximum length of a utility's input line length, either from
standard input or from a file. This includes length for a trailing
newline.
The corresponding macro is
.BR LINE_MAX .
.TP
.B _SC_RE_DUP_MAX
The maximum number of repeated occurrences of a regular expression when
the interval notation
.B \e{m,n\e}
is used. The value of the corresponding macro is
.BR RE_DUP_MAX .
.TP
.B _SC_2_VERSION
indicates the version of the POSIX.2 standard in the format of
YYYYMML.  The corresponding macro is
.BR POSIX2_VERSION .
.TP
.B _SC_2_DEV
indicates whether the POSIX.2 C language development facilities are
supported.  The corresponding macro is
.BR POSIX2_C_DEV .
.TP
.B _SC_2_FORT_DEV
indicates whether the POSIX.2 FORTRAN development utilities are
supported.  The corresponding macro is
.BR POSIX2_FORT_RUN .
.TP
.B _SC_2_FORT_RUN
indicates whether the POSIX.2 FORTRAN runtime utilities are supported.
The corresponding macro is
.BR POSIX2_FORT_RUN .
.TP
.B _SC_2_LOCALEDEF
indicates whether the POSIX.2 creation of locates via
.BR localedef (1)
is supported.
The corresponding macro is
.BR _POSIX2_LOCALEDEF .
.TP
.B _SC_2_SW_DEV
indicates whether the POSIX.2 software development utilities option is
supported.
The corresponding macro is
.BR POSIX2_SW_DEV .
.SH "RETURN VALUE"
The value returned is the value of the system resource, 1 if a queried
option is available, 0 if it is not, or \-1 on error.  The variable
.I errno
is not set.
.SH "CONFORMING TO"
POSIX.1, proposed POSIX.2
.SH "BUGS"
It is difficult to use
.B ARG_MAX
because it is not specified how much of the argument space for
.B exec()
is consumed by the user's environment variables.
.PP
Some returned values may be huge; they are not suitable for allocating
memory.
.PP
POSIX.2 is not yet an approved standard; the information in this
manpage is subject to change.
.SH "SEE ALSO"
.BR bc "(1), " expr "(1), " locale "(1), " fpathconf "(3), " pathconf (3)