1getconf(1)                       User Commands                      getconf(1)
2
3
4

NAME

6       getconf - get configuration values
7

SYNOPSIS

9   /usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf
10       /usr/bin/getconf [-v specification] system_var
11
12
13       /usr/bin/getconf [-v specification] path_var pathname
14
15
16       /usr/bin/getconf -a
17
18
19       /usr/xpg4/bin/getconf [-v specification] system_var
20
21
22       /usr/xpg4/bin/getconf [-v specification] path_var pathname
23
24
25       /usr/xpg4/bin/getconf -a
26
27
28       /usr/xpg6/bin/getconf [-v specification] system_var
29
30
31       /usr/xpg6/bin/getconf [-v specification] path_var pathname
32
33
34       /usr/xpg6/bin/getconf -a
35
36
37   ksh93
38       getconf [-abdlpqrtw] [-c RE] [-n RE] [-s RE] [-v name][name [path [value]] ...]
39
40

DESCRIPTION

42   /usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf
43       In  the first synopsis form, the getconf utility writes to the standard
44       output the value of the variable specified by system_var, in accordance
45       with specification if the -v option is used.
46
47
48       In  the second synopsis form, getconf writes to the standard output the
49       value of the variable specified by path_var for the path  specified  by
50       pathname, in accordance with specification if the -v option is used.
51
52
53       In  the  third  synopsis form, config writes to the standard output the
54       names of the current system configuration variables.
55
56
57       The value of each configuration variable is determined as  if  it  were
58       obtained  by calling the function from which it is defined to be avail‐
59       able. The value reflects conditions in the current  operating  environ‐
60       ment.
61
62   ksh93
63       The  getconf built-in in ksh93 is associated with the /bin and /usr/bin
64       paths. It is invoked when getconf is executed without a pathname prefix
65       and  the  pathname search finds a /bin/getconf or /usr/bin/getconf exe‐
66       cutable.
67
68
69       getconf displays the system configuration value for name. If name is  a
70       filesystem specific variable, the value is determined relative to path,
71       or, the current directory, if path is omitted. If value  is  specified,
72       getconf  attempts  to change the process local value to value. - can be
73       used in place of path when it is not relevant. Only writable  variables
74       can be set. readonly variables cannot be changed.
75
76
77       The  current  value for name is written to the standard output. If name
78       is valid but undefined, undefined is written to the standard output. If
79       name is invalid or an error occurs in determining its value, a diagnos‐
80       tic is written to standard error and getconf exits with a non-zero exit
81       status.
82
83
84       More than one variable can be set or queried by providing the name path
85       value 3-tuple for each variable, specifying - for value when querying.
86
87
88       If no operands are  specified,  all  known  variables  are  written  in
89       name=value  form  to  the  standard  output,  one per line. Only one of
90       --call, --name or --standard can be specified.
91

OPTIONS

93   /usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf
94       The   following   options   are    supported    by    /usr/bin/getconf,
95       /usr/xpg4/bin/getconf, and /usr/xpg6/bin/getconf
96
97       -a                 Writes the names of the current system configuration
98                          variables to the standard output.
99
100
101       -vspecification    Gives the specification which governs the  selection
102                          of values for configuration variables.
103
104
105   ksh93
106       The  following options are supported by the getconf built-in command in
107       ksh93:
108
109       -a                      Call the native getconf -a.
110       --all
111
112       -b                      List base variable name without call and  stan‐
113       --base                  dard prefixes.
114
115
116       -c                      Display variables with call prefix that matches
117       --call=RE               RE. The call prefixes are:
118
119                                   o      CS
120
121                                          confstr(3C),
122
123                                   o      PC
124
125                                          pathconf(2)
126
127                                   o      SC
128
129                                          sysconf(3C)
130
131                                   o      SI
132
133                                          sysinfo(2)
134
135                                   o      XX
136
137                                          Constant value
138
139
140       -d                      Only display defined values  when  no  operands
141       --defined               are specified.
142
143
144       -l                      List variable names in lower case.
145       --lowercase
146
147       -n                      Display variables with names that match RE.
148       --name=RE
149
150       -p                      Display the named writable variables and values
151       --portable              in a form that  can  be  directly  executed  by
152                               ksh93(1) to set the values. If name is omitted,
153                               lists all writable variables.
154
155
156       -q                      Quote values ("...").
157       --quote
158
159       -r                      Display  the  named   readonly   variables   in
160       --readonly              name=value  form. If name is omitted, lists all
161                               readonly variables.
162
163
164       -s                      Display variables  with  standard  prefix  that
165       --standard=RE           matches  RE. Use the --table option to view all
166                               standard prefixes, including local additions.
167
168                               The standard prefixes available on all  systems
169                               are:
170
171
172                                 AES
173                                 AST
174                                 C
175                                 GNU
176                                 POSIX
177                                 SVID
178                                 XBS5
179                                 XOPEN
180                                 XPG
181
182
183
184
185       -t                      Display  the  internal  table that contains the
186       --table                 name, standard, standard  section,  and  system
187                               call symbol prefix for each variable.
188
189
190       -w                      Display   the   named   writable  variables  in
191       --writable              name=value form. If name is omitted, lists  all
192                               writable variables.
193
194
195       -v                      Call the native getconf -v name.
196       --specification=name
197

OPERANDS

199   /usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf
200       The    following    operands   are   supported   by   /usr/bin/getconf,
201       /usr/xpg4/bin/getconf, and /usr/xpg6/bin/getconf:
202
203       path_var    A name of a configuration variable whose value is available
204                   from  the  pathconf(2)  function.  All of the values in the
205                   following table are supported:
206
207
208
209
210
211       LINK_MAX             NAME_MAX              _POSIX_CHOWN_RESTRICTED
212       MAX_CANON            PATH_MAX              _POSIX_NO_TRUNC
213       MAX_INPUT            PIPE_BUF              _POSIX_VDISABLE
214
215
216       pathname      A path name for which the variable specified by  path_var
217                     is to be determined.
218
219
220       system_var    A  name of a configuration variable whose value is avail‐
221                     able from confstr(3C) or sysconf(3C). All of  the  values
222                     in the following table are supported:
223
224
225
226
227
228       ARG_MAX                               BC_BASE_MAX
229       BC_DIM_MAX                            BC_SCALE_MAX
230       BC_STRING_MAX                         CHAR_BIT
231       CHARCLASS_NAME_MAX                    CHAR_MAX
232       CHAR_MIN                              CHILD_MAX
233       CLK_TCK                               COLL_WEIGHTS_MAX
234       CS_PATH                               EXPR_NEST_MAX
235       HOST_NAME_MAX                         INT_MAX
236       INT_MIN                               LFS64_CFLAGS
237       LFS64_LDFLAGS                         LFS64_LIBS
238       LFS64_LINTFLAGS                       LFS_CFLAGS
239       LFS_LDFLAGS                           LFS_LIBS
240       LFS_LINTFLAGS                         LINE_MAX
241       LONG_BIT                              LONG_MAX
242       LONG_MIN                              MB_LEN_MAX
243       NGROUPS_MAX                           NL_ARGMAX
244       NL_LANGMAX                            NL_MSGMAX
245       NL_NMAX                               NL_SETMAX
246       NL_TEXTMAX                            NZERO
247       OPEN_MAX                              POSIX2_BC_BASE_MAX
248       POSIX2_BC_DIM_MAX                     POSIX2_BC_SCALE_MAX
249       POSIX2_BC_STRING_MAX                  POSIX2_C_BIND
250       POSIX2_C_DEV                          POSIX2_CHAR_TERM
251       POSIX2_COLL_WEIGHTS_MAX               POSIX2_C_VERSION
252       POSIX2_EXPR_NEST_MAX                  POSIX2_FORT_DEV
253       POSIX2_FORT_RUN                       POSIX2_LINE_MAX
254       POSIX2_LOCALEDEF                      POSIX2_RE_DUP_MAX
255       POSIX2_SW_DEV                         POSIX2_SYMLINKS
256       POSIX2_UPE                            POSIX2_VERSION
257       POSIX_ALLOC_SIZE_MIN                  POSIX_REC_INCR_XFER_SIZE
258       POSIX_REC_MAX_XFER_SIZE               POSIX_REC_MIN_XFER_SIZE
259       POSIX_REC_XFER_ALIGN                  POSIX_V6_ILP32_OFF32
260       POSIX_V6_ILP32_OFF32_CFLAGS           POSIX_V6_ILP32_OFF32_LDFLAGS
261       POSIX_V6_ILP32_OFF32_LIBS             POSIX_V6_ILP32_OFFBIG
262       POSIX_V6_ILP32_OFFBIG_CFLAGS          POSIX_V6_ILP32_OFFBIG_LDFLAGS
263       POSIX_V6_ILP32_OFFBIG_LIBS            POSIX_V6_LP64_OFF64
264       POSIX_V6_LP64_OFF64_CFLAGS            POSIX_V6_LP64_OFF64_LDFLAGS
265       POSIX_V6_LP64_OFF64_LIBS              POSIX_V6_LPBIG_OFFBIG
266       POSIX_V6_LPBIG_OFFBIG_CFLAGS          POSIX_V6_LPBIG_OFFBIG_LDFLAGS
267       POSIX_V6_LPBIG_OFFBIG_LIBS            POSIX_V6_WIDTH_RESTRICTED_ENVS
268       SYMLINK_MAX                           SYMLOOP_MAX
269       _POSIX2_BC_BASE_MAX                   _POSIX2_BC_DIM_MAX
270
271       _POSIX2_BC_SCALE_MAX                  _POSIX2_BC_STRING_MAX
272       _POSIX2_CHARCLASS_NAME_MAX            _POSIX2_CHAR_TERM
273       _POSIX2_COLL_WEIGHTS_MAX              _POSIX2_C_BIND
274       _POSIX2_C_DEV                         _POSIX2_C_VERSION
275       _POSIX2_EXPR_NEST_MAX                 _POSIX2_FORT_DEV
276       _POSIX2_FORT_RUN                      _POSIX2_LINE_MAX
277       _POSIX2_LOCALEDEF                     _POSIX2_PBS
278       _POSIX2_PBS_ACCOUNTING                _POSIX2_PBS_CHECKPOINT
279       _POSIX2_PBS_LOCATE                    _POSIX2_PBS_MESSAGE
280       _POSIX2_PBS_TRACK                     _POSIX2_RE_DUP_MAX
281       _POSIX2_SW_DEV                        _POSIX2_UPE
282       _POSIX2_VERSION                       _POSIX_ADVISORY_INFO
283       _POSIX_AIO_LISTIO_MAX                 _POSIX_AIO_MAX
284       _POSIX_ARG_MAX                        _POSIX_ASYNC_IO
285       _POSIX_BARRIERS                       _POSIX_CHILD_MAX
286       _POSIX_CLOCKRES_MIN                   _POSIX_CLOCK_SELECTION
287       _POSIX_CPUTIME                        _POSIX_DELAYTIMER_MAX
288       _POSIX_HOST_NAME_MAX                  _POSIX_IPV6
289       _POSIX_JOB_CONTROL                    _POSIX_LINK_MAX
290       _POSIX_LOGIN_NAME_MAX                 _POSIX_MAX_CANON
291       _POSIX_MAX_INPUT                      _POSIX_MONOTONIC_CLOCK
292       _POSIX_MQ_OPEN_MAX                    _POSIX_MQ_PRIO_MAX
293       _POSIX_NAME_MAX                       _POSIX_NGROUPS_MAX
294       _POSIX_OPEN_MAX                       _POSIX_PATH_MAX
295       _POSIX_PIPE_BUF                       _POSIX_PRIO_IO
296       _POSIX_RAW_SOCKETS                    _POSIX_READER_WRITER_LOCKS
297       _POSIX_REGEXP                         _POSIX_RE_DUP_MAX
298       _POSIX_RTSIG_MAX                      _POSIX_SAVED_IDS
299       _POSIX_SEM_NSEMS_MAX                  _POSIX_SEM_VALUE_MAX
300       _POSIX_SHELL                          _POSIX_SIGQUEUE_MAX
301       _POSIX_SPAWN                          _POSIX_SPIN_LOCKS
302       _POSIX_SPORADIC_SERVER                _POSIX_SSIZE_MAX
303       _POSIX_SS_REPL_MAX                    _POSIX_STREAM_MAX
304       _POSIX_SYMLINK_MAX                    _POSIX_SYMLOOP_MAX
305       _POSIX_SYNC_IO                        _POSIX_THREAD_ATTR_STACKADDR
306       _POSIX_THREAD_ATTR_STACKSIZE          _POSIX_THREAD_CPUTIME
307       _POSIX_THREAD_DESTRUCTOR_ITERATIONS   _POSIX_THREAD_KEYS_MAX
308       _POSIX_THREAD_PRIORITY_SCHEDULING     _POSIX_THREAD_PRIO_INHERIT
309       _POSIX_THREAD_PRIO_PROTECT            _POSIX_THREAD_PROCESS_SHARED
310       _POSIX_THREAD_SAFE_FUNCTIONS          _POSIX_THREAD_SPORADIC_SERVER
311       _POSIX_THREAD_THREADS_MAX             _POSIX_TIMEOUTS
312       _POSIX_TIMER_MAX                      _POSIX_TRA_POSIX_TIMER_MAXCE
313       _POSIX_TIMESTAMP_RESOLUTION
314       _POSIX_TRACE_EVENT_FILTER             _POSIX_TRACE_EVENT_NAME_MAX
315       _POSIX_TRACE_INHERIT                  _POSIX_TRACE_LOG
316       _POSIX_TRACE_NAME_MAX                 _POSIX_TRACE_SYS_MAX
317       _POSIX_TRACE_USER_EVENT_MAX           _POSIX_TTY_NAME_MAX
318       _POSIX_TYPED_MEMORY_OBJECTS           _POSIX_TZNAME_MAX
319       _POSIX_VERSION                        _POSIX_V6_ILP32_OFF32
320       _POSIX_V6_ILP32_OFFBIG                _POSIX_V6_LP64_OFF64
321       _POSIX_V6_LPBIG_OFFBIG                _V6_ILP32_OFF32
322       _V6_ILP32_OFFBIG                      _V6_LP64_OFF64
323       _V6_LPBIG_OFFBIG                      RE_DUP_MAX
324       SCHAR_MAX                             SCHAR_MIN
325       SHRT_MAX                              SHRT_MIN
326       SSIZE_MAX                             STREAM_MAX
327       TMP_MAX                               TZNAME_MAX
328       UCHAR_MAX                             UINT_MAX
329       ULONG_MAX                             USHRT_MAX
330       WORD_BIT                              XBS5_ILP32_OFF32
331       XBS5_ILP32_OFF32_CFLAGS               XBS5_ILP32_OFF32_LDFLAGS
332       XBS5_ILP32_OFF32_LIBS                 XBS5_ILP32_OFF32_LINTFLAGS
333       XBS5_ILP32_OFFBIG                     XBS5_ILP32_OFFBIG_CFLAGS
334       XBS5_ILP32_OFFBIG_LDFLAGS             XBS5_ILP32_OFFBIG_LIBS
335       XBS5_ILP32_OFFBIG_LINTFLAGS           XBS5_LP64_OFF64
336       XBS5_LP64_OFF64_CFLAGS                XBS5_LP64_OFF64_LDFLAGS
337       XBS5_LP64_OFF64_LIBS                  XBS5_LP64_OFF64_LINTFLAGS
338       XBS5_LPBIG_OFFBIG                     XBS5_LPBIG_OFFBIG_CFLAGS
339
340       XBS5_LPBIG_OFFBIG_LDFLAGS             XBS5_LPBIG_OFFBIG_LIBS
341       XBS5_LPBIG_OFFBIG_LINTFLAGS           _XOPEN_CRYPT
342       _XOPEN_ENH_I18N                       _XOPEN_IOV_MAX
343       _XOPEN_LEGACY                         _XOPEN_NAME_MAX
344       _XOPEN_PATH_MAX                       _XOPEN_SHM
345       _XOPEN_STREAMS                        _XOPEN_VERSION
346       _XOPEN_XCU_VERSION                    _XOPEN_XPG2
347       _XOPEN_XPG3                           _XOPEN_XPG4
348
349
350
351       The symbol PATH also is recognized, yielding the same value as the con‐
352       fstr() name value CS_PATH.
353

USAGE

355       See largefile(5) for the description of the behavior  of  /usr/bin/get‐
356       conf  when  encountering  files greater than or equal to 2 Gbyte ( 2^31
357       bytes).
358

EXAMPLES

360       Example 1 Writing the Value of a Variable
361
362
363       This example illustrates the value of {NGROUPS_MAX}:
364
365
366         example% getconf NGROUPS_MAX
367
368
369
370       Example 2 Writing the Value of a Variable for a Specific Directory
371
372
373       This example illustrates the value of NAME_MAX for  a  specific  direc‐
374       tory:
375
376
377         example% getconf NAME_MAX /usr
378
379
380
381       Example 3 Dealing with Unspecified Results
382
383
384       This  example  shows how to deal more carefully with results that might
385       be unspecified:
386
387
388         if value=$(getconf PATH_MAX /usr); then
389         if [ "$value" = "undefined" ]; then
390         echo PATH_MAX in /usr is infinite.
391         else
392         echo PATH_MAX in /usr is $value.
393         fi
394         else
395         echo Error in getconf.
396         fi
397
398
399
400       For example:
401
402
403         sysconf(_SC_POSIX_C_BIND);
404
405
406
407       and
408
409
410         system("getconf POSIX2_C_BIND");
411
412
413
414       in a C program could give different answers. The sysconf call  supplies
415       a  value that corresponds to the conditions when the program was either
416       compiled or executed, depending on the implementation. The system  call
417       to getconf always supplies a value corresponding to conditions when the
418       program is executed.
419
420

ENVIRONMENT VARIABLES

422       See environ(5) for descriptions of the following environment  variables
423       that  affect  the execution of getconf: LANG, LC_ALL, LC_CTYPE, LC_MES‐
424       SAGES, and NLSPATH.
425
426
427       The following environment variable is supported by the  ksh93  built-in
428       getconf command:
429
430       _AST_FEATURES    Local  writable  values  that  are  different from the
431                        default are stored in  the  _AST_FEATURES  environment
432                        variable. The _AST_FEATURES value is a space-separated
433                        list of name path value 3-tuples, where  name  is  the
434                        system  configuration  name, path is the corresponding
435                        path, - if no path is applicable,  and  value  is  the
436                        system configuration value.
437
438

EXIT STATUS

440       The following exit values are returned:
441
442       0     The specified variable is valid and information about its current
443             state was written successfully.
444
445
446       >0    An error occurred.
447
448

ATTRIBUTES

450       See attributes(5) for descriptions of the following attributes:
451
452   /usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf
453       ┌─────────────────────────────┬─────────────────────────────┐
454       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
455       ├─────────────────────────────┼─────────────────────────────┤
456       │Availability                 │SUNWcsu                      │
457       ├─────────────────────────────┼─────────────────────────────┤
458       │Interface Stability          │Committed                    │
459       ├─────────────────────────────┼─────────────────────────────┤
460       │Standard                     │See standards(5).            │
461       └─────────────────────────────┴─────────────────────────────┘
462
463   ksh93
464       ┌─────────────────────────────┬─────────────────────────────┐
465       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
466       ├─────────────────────────────┼─────────────────────────────┤
467       │Availability                 │SUNWcsu                      │
468       ├─────────────────────────────┼─────────────────────────────┤
469       │Interface Stability          │See below.                   │
470       └─────────────────────────────┴─────────────────────────────┘
471
472
473       The ksh93 built-in binding to /bin and /usr/bin is Volatile. The built-
474       in command-line interface is Committed.
475

SEE ALSO

477       ksh93(1),  sh(1),  pathconf(2),  sysinfo(2),  confstr(3C), sysconf(3C),
478       attributes(5), environ(5), largefile(5), standards(5)
479
480
481
482SunOS 5.11                        1 Sep 2009                        getconf(1)
Impressum