Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / getconf.1
blobe7c21d70b3a547643324b26d351c0890fa10da74
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved
44 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
45 .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
46 .\"
47 .TH GETCONF 1 "Oct 25, 2017"
48 .SH NAME
49 getconf \- get configuration values
50 .SH SYNOPSIS
51 .LP
52 .nf
53 \fB/usr/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR
54 .fi
56 .LP
57 .nf
58 \fB/usr/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR
59 .fi
61 .LP
62 .nf
63 \fB/usr/bin/getconf\fR \fB-a\fR
64 .fi
66 .SS "ksh93"
67 .LP
68 .nf
69 \fBgetconf\fR [\fB-abdlpqrtw\fR] [\fB-c\fR RE] [\fB-n\fR RE] [\fB-s\fR RE] [\fB-v\fR \fIname\fR][\fIname\fR [\fIpath\fR [\fIvalue\fR]] ...]
70 .fi
72 .SH DESCRIPTION
73 .sp
74 .LP
75 In the first synopsis form, the \fBgetconf\fR utility writes to the standard
76 output the value of the variable specified by \fIsystem_var\fR, in accordance
77 with \fIspecification\fR if the \fB-v\fR option is used.
78 .sp
79 .LP
80 In the second synopsis form, \fBgetconf\fR writes to the standard output the
81 value of the variable specified by \fIpath_var\fR for the path specified by
82 \fIpathname\fR, in accordance with \fIspecification\fR if the \fB-v\fR option
83 is used.
84 .sp
85 .LP
86 In the third synopsis form, \fBconfig\fR writes to the standard output the
87 names of the current system configuration variables.
88 .sp
89 .LP
90 The value of each configuration variable is determined as if it were obtained
91 by calling the function from which it is defined to be available. The value
92 reflects conditions in the current operating environment.
93 .SS "ksh93"
94 .sp
95 .LP
96 The \fBgetconf\fR built-in in \fBksh93\fR is associated with the \fB/bin\fR and
97 \fB/usr/bin\fR paths. It is invoked when \fBgetconf\fR is executed without a
98 pathname prefix and the pathname search finds a \fB/bin/getconf\fR or
99 \fB/usr/bin/getconf\fR executable.
102 \fBgetconf\fR displays the system configuration value for \fIname\fR. If
103 \fIname\fR is a filesystem specific variable, the value is determined relative
104 to path, or, the current directory, if path is omitted. If \fIvalue\fR is
105 specified, \fBgetconf\fR attempts to change the process local value to
106 \fIvalue\fR. \fB-\fR can be used in place of path when it is not relevant. Only
107 writable variables can be set. \fBreadonly\fR variables cannot be changed.
110 The current value for \fIname\fR is written to the standard output. If
111 \fIname\fR is valid but undefined, \fBundefined\fR is written to the standard
112 output. If \fIname\fR is invalid or an error occurs in determining its value, a
113 diagnostic is written to standard error and \fBgetconf\fR exits with a
114 \fBnon-zero\fR exit status.
117 More than one variable can be set or queried by providing the \fIname path
118 value\fR 3-tuple for each variable, specifying \fB-\fR for value when querying.
121 If no operands are specified, all known variables are written in
122 \fIname\fR\fB=\fR\fIvalue\fR form to the standard output, one per line. Only
123 one of \fB--call\fR, \fB--name\fR or \fB--standard\fR can be specified.
124 .SH OPTIONS
127 The following options are supported:
129 .ne 2
131 \fB\fB-a\fR\fR
133 .RS 19n
134 Writes the names of the current system configuration variables to the standard
135 output.
139 .ne 2
141 \fB\fB-v\fR\fIspecification\fR\fR
143 .RS 19n
144 Gives the specification which governs the selection of values for configuration
145 variables.
148 .SS "ksh93"
151 The following options are supported by the \fBgetconf\fR built-in command in
152 \fBksh93\fR:
154 .ne 2
156 \fB\fB-a\fR\fR
160 \fB\fB--all\fR\fR
162 .RS 24n
163 Call the native \fBgetconf -a\fR.
167 .ne 2
169 \fB\fB-b\fR\fR
173 \fB\fB--base\fR\fR
175 .RS 24n
176 List base variable name without \fBcall\fR and standard prefixes.
180 .ne 2
182 \fB\fB-c\fR\fR
186 \fB\fB--call=\fR\fIRE\fR\fR
188 .RS 24n
189 Display variables with \fBcall\fR prefix that matches \fIRE\fR. The \fBcall\fR
190 prefixes are:
191 .RS +4
193 .ie t \(bu
194 .el o
195 \fBCS\fR
197 \fBconfstr\fR(3C),
199 .RS +4
201 .ie t \(bu
202 .el o
203 \fBPC\fR
205 \fBpathconf\fR(2)
207 .RS +4
209 .ie t \(bu
210 .el o
211 \fBSC\fR
213 \fBsysconf\fR(3C)
215 .RS +4
217 .ie t \(bu
218 .el o
219 \fBSI\fR
221 \fBsysinfo\fR(2)
223 .RS +4
225 .ie t \(bu
226 .el o
227 \fBXX\fR
229 Constant value
234 .ne 2
236 \fB\fB-d\fR\fR
240 \fB\fB--defined\fR\fR
242 .RS 24n
243 Only display defined values when no operands are specified.
247 .ne 2
249 \fB\fB-l\fR\fR
253 \fB\fB--lowercase\fR\fR
255 .RS 24n
256 List variable names in lower case.
260 .ne 2
262 \fB\fB-n\fR\fR
266 \fB\fB--name=\fR\fIRE\fR\fR
268 .RS 24n
269 Display variables with names that match \fIRE\fR.
273 .ne 2
275 \fB\fB-p\fR\fR
279 \fB\fB--portable\fR\fR
281 .RS 24n
282 Display the named writable variables and values in a form that can be directly
283 executed by \fBksh93\fR(1) to set the values. If \fIname\fR is omitted, lists
284 all writable variables.
288 .ne 2
290 \fB\fB-q\fR\fR
294 \fB\fB--quote\fR\fR
296 .RS 24n
297 Quote values (\fB"..."\fR).
301 .ne 2
303 \fB\fB-r\fR\fR
307 \fB\fB--readonly\fR\fR
309 .RS 24n
310 Display the named \fBreadonly\fR variables in \fIname\fR\fB=\fR\fIvalue\fR
311 form. If \fIname\fR is omitted, lists all \fBreadonly\fR variables.
315 .ne 2
317 \fB\fB-s\fR\fR
321 \fB\fB--standard=\fR\fIRE\fR\fR
323 .RS 24n
324 Display variables with standard prefix that matches \fIRE\fR. Use the
325 \fB--table\fR option to view all standard prefixes, including local additions.
327 The standard prefixes available on all systems are:
329 .in +2
336 POSIX
337 SVID
338 XBS5
339 XOPEN
342 .in -2
348 .ne 2
350 \fB\fB-t\fR\fR
354 \fB\fB--table\fR\fR
356 .RS 24n
357 Display the internal table that contains the name, standard, standard section,
358 and system call symbol prefix for each variable.
362 .ne 2
364 \fB\fB-w\fR\fR
368 \fB\fB--writable\fR\fR
370 .RS 24n
371 Display the named writable variables in \fIname\fR\fB=\fR\fIvalue\fR form. If
372 \fIname\fR is omitted, lists all writable variables.
376 .ne 2
378 \fB\fB-v\fR\fR
382 \fB\fB--specification=name\fR\fR
384 .RS 24n
385 Call the native \fBgetconf -v\fR \fIname\fR.
388 .SH OPERANDS
391 The following operands are supported:
393 .ne 2
395 \fB\fIpath_var\fR\fR
397 .RS 12n
398 A name of a configuration variable whose value is available from the
399 \fBpathconf\fR(2) function. All of the values in the following table are
400 supported:
407 l l l
408 l l l .
409 ACL_ENABLED     NAME_MAX        XATTR_ENABLED
410 LINK_MAX        PATH_MAX        XATTR_EXISTS
411 MAX_CANON       PIPE_BUF        _POSIX_CHOWN_RESTRICTED
412 MAX_INPUT       SATTR_ENABLED   _POSIX_NO_TRUNC
413 MIN_HOLE_SIZE   SATTR_EXISTS    _POSIX_VDISABLE
417 .ne 2
419 \fB\fIpathname\fR\fR
421 .RS 14n
422 A path name for which the variable specified by \fIpath_var\fR is to be
423 determined.
427 .ne 2
429 \fB\fIsystem_var\fR\fR
431 .RS 14n
432 A name of a configuration variable whose value is available from
433 \fBconfstr\fR(3C) or \fBsysconf\fR(3C). All of the values in the following
434 table are supported:
441 l l
442 l l .
443 ARG_MAX BC_BASE_MAX
444 BC_DIM_MAX      BC_SCALE_MAX
445 BC_STRING_MAX   CHAR_BIT
446 CHARCLASS_NAME_MAX      CHAR_MAX
447 CHAR_MIN        CHILD_MAX
448 CLK_TCK COLL_WEIGHTS_MAX
449 CS_PATH EXPR_NEST_MAX
450 HOST_NAME_MAX   INT_MAX
451 INT_MIN
452 LINE_MAX
453 LONG_BIT        LONG_MAX
454 LONG_MIN        MB_LEN_MAX
455 NGROUPS_MAX     NL_ARGMAX
456 NL_LANGMAX      NL_MSGMAX
457 NL_NMAX NL_SETMAX
458 NL_TEXTMAX      NPROCESSORS_CONF
459 NPROCESSORS_MAX NPROCESSORS_ONLN
460 NZERO   OPEN_MAX
461 POSIX2_BC_BASE_MAX      POSIX2_BC_DIM_MAX
462 POSIX2_BC_SCALE_MAX     POSIX2_BC_STRING_MAX
463 POSIX2_C_BIND   POSIX2_C_DEV
464 POSIX2_CHAR_TERM        POSIX2_COLL_WEIGHTS_MAX
465 POSIX2_C_VERSION        POSIX2_EXPR_NEST_MAX
466 POSIX2_FORT_DEV POSIX2_FORT_RUN
467 POSIX2_LINE_MAX POSIX2_LOCALEDEF
468 POSIX2_RE_DUP_MAX       POSIX2_SW_DEV
469 POSIX2_SYMLINKS POSIX2_UPE
470 POSIX2_VERSION  POSIX_ALLOC_SIZE_MIN
471 POSIX_REC_INCR_XFER_SIZE        POSIX_REC_MAX_XFER_SIZE
472 POSIX_REC_MIN_XFER_SIZE POSIX_REC_XFER_ALIGN
473 POSIX_V6_ILP32_OFF32    POSIX_V6_ILP32_OFF32_CFLAGS
474 POSIX_V6_ILP32_OFF32_LDFLAGS    POSIX_V6_ILP32_OFF32_LIBS
475 POSIX_V6_ILP32_OFFBIG   POSIX_V6_ILP32_OFFBIG_CFLAGS
476 POSIX_V6_ILP32_OFFBIG_LDFLAGS   POSIX_V6_ILP32_OFFBIG_LIBS
477 POSIX_V6_LP64_OFF64     POSIX_V6_LP64_OFF64_CFLAGS
478 POSIX_V6_LP64_OFF64_LDFLAGS     POSIX_V6_LP64_OFF64_LIBS
479 POSIX_V6_LPBIG_OFFBIG   POSIX_V6_LPBIG_OFFBIG_CFLAGS
480 POSIX_V6_LPBIG_OFFBIG_LDFLAGS   POSIX_V6_LPBIG_OFFBIG_LIBS
481 POSIX_V6_WIDTH_RESTRICTED_ENVS  SYMLINK_MAX
482 SYMLOOP_MAX     _POSIX2_BC_BASE_MAX
483 _POSIX2_BC_DIM_MAX      _POSIX2_BC_SCALE_MAX
484 _POSIX2_BC_STRING_MAX   _POSIX2_CHARCLASS_NAME_MAX
485 _POSIX2_CHAR_TERM       _POSIX2_COLL_WEIGHTS_MAX
486 _POSIX2_C_BIND  _POSIX2_C_DEV
487 _POSIX2_C_VERSION       _POSIX2_EXPR_NEST_MAX
488 _POSIX2_FORT_DEV        _POSIX2_FORT_RUN
489 _POSIX2_LINE_MAX        _POSIX2_LOCALEDEF
490 _POSIX2_PBS     _POSIX2_PBS_ACCOUNTING
491 _POSIX2_PBS_CHECKPOINT  _POSIX2_PBS_LOCATE
492 _POSIX2_PBS_MESSAGE     _POSIX2_PBS_TRACK
493 _POSIX2_RE_DUP_MAX      _POSIX2_SW_DEV
494 _POSIX2_UPE     _POSIX2_VERSION
495 _POSIX_ADVISORY_INFO    _POSIX_AIO_LISTIO_MAX
496 _POSIX_AIO_MAX  _POSIX_ARG_MAX
497 _POSIX_ASYNC_IO _POSIX_BARRIERS
498 _POSIX_CHILD_MAX        _POSIX_CLOCKRES_MIN
499 _POSIX_CLOCK_SELECTION  _POSIX_CPUTIME
500 _POSIX_DELAYTIMER_MAX   _POSIX_HOST_NAME_MAX
501 _POSIX_IPV6     _POSIX_JOB_CONTROL
502 _POSIX_LINK_MAX _POSIX_LOGIN_NAME_MAX
503 _POSIX_MAX_CANON        _POSIX_MAX_INPUT
504 _POSIX_MONOTONIC_CLOCK  _POSIX_MQ_OPEN_MAX
505 _POSIX_MQ_PRIO_MAX      _POSIX_NAME_MAX
506 _POSIX_NGROUPS_MAX      _POSIX_OPEN_MAX
507 _POSIX_PATH_MAX _POSIX_PIPE_BUF
508 _POSIX_PRIO_IO  _POSIX_RAW_SOCKETS
509 _POSIX_READER_WRITER_LOCKS      _POSIX_REGEXP
510 _POSIX_RE_DUP_MAX       _POSIX_RTSIG_MAX
511 _POSIX_SAVED_IDS        _POSIX_SEM_NSEMS_MAX
512 _POSIX_SEM_VALUE_MAX    _POSIX_SHELL
513 _POSIX_SIGQUEUE_MAX     _POSIX_SPAWN
514 _POSIX_SPIN_LOCKS       _POSIX_SPORADIC_SERVER
515 _POSIX_SSIZE_MAX        _POSIX_SS_REPL_MAX
516 _POSIX_STREAM_MAX       _POSIX_SYMLINK_MAX
517 _POSIX_SYMLOOP_MAX      _POSIX_SYNC_IO
518 _POSIX_THREAD_ATTR_STACKADDR    _POSIX_THREAD_ATTR_STACKSIZE
519 _POSIX_THREAD_CPUTIME   _POSIX_THREAD_DESTRUCTOR_ITERATIONS
520 _POSIX_THREAD_KEYS_MAX  _POSIX_THREAD_PRIORITY_SCHEDULING
521 _POSIX_THREAD_PRIO_INHERIT      _POSIX_THREAD_PRIO_PROTECT
522 _POSIX_THREAD_PROCESS_SHARED    _POSIX_THREAD_SAFE_FUNCTIONS
523 _POSIX_THREAD_SPORADIC_SERVER   _POSIX_THREAD_THREADS_MAX
524 _POSIX_TIMEOUTS _POSIX_TIMER_MAX
525 _POSIX_TRA_POSIX_TIMER_MAXCE    _POSIX_TIMESTAMP_RESOLUTION
526 _POSIX_TRACE_EVENT_FILTER       _POSIX_TRACE_EVENT_NAME_MAX
527 _POSIX_TRACE_INHERIT    _POSIX_TRACE_LOG
528 _POSIX_TRACE_NAME_MAX   _POSIX_TRACE_SYS_MAX
529 _POSIX_TRACE_USER_EVENT_MAX     _POSIX_TTY_NAME_MAX
530 _POSIX_TYPED_MEMORY_OBJECTS     _POSIX_TZNAME_MAX
531 _POSIX_VERSION  _POSIX_V6_ILP32_OFF32
532 _POSIX_V6_ILP32_OFFBIG  _POSIX_V6_LP64_OFF64
533 _POSIX_V6_LPBIG_OFFBIG  _V6_ILP32_OFF32
534 _V6_ILP32_OFFBIG        _V6_LP64_OFF64
535 _V6_LPBIG_OFFBIG        RE_DUP_MAX
536 SCHAR_MAX       SCHAR_MIN
537 SHRT_MAX        SHRT_MIN
538 SSIZE_MAX       STREAM_MAX
539 TMP_MAX TZNAME_MAX
540 UCHAR_MAX       UINT_MAX
541 ULONG_MAX       USHRT_MAX
542 WORD_BIT        XBS5_ILP32_OFF32
543 XBS5_ILP32_OFF32_CFLAGS XBS5_ILP32_OFF32_LDFLAGS
544 XBS5_ILP32_OFF32_LIBS   XBS5_ILP32_OFF32_LINTFLAGS
545 XBS5_ILP32_OFFBIG       XBS5_ILP32_OFFBIG_CFLAGS
546 XBS5_ILP32_OFFBIG_LDFLAGS       XBS5_ILP32_OFFBIG_LIBS
547 XBS5_ILP32_OFFBIG_LINTFLAGS     XBS5_LP64_OFF64
548 XBS5_LP64_OFF64_CFLAGS  XBS5_LP64_OFF64_LDFLAGS
549 XBS5_LP64_OFF64_LIBS    XBS5_LP64_OFF64_LINTFLAGS
550 XBS5_LPBIG_OFFBIG       XBS5_LPBIG_OFFBIG_CFLAGS
551 XBS5_LPBIG_OFFBIG_LDFLAGS       XBS5_LPBIG_OFFBIG_LIBS
552 XBS5_LPBIG_OFFBIG_LINTFLAGS     _XOPEN_CRYPT
553 _XOPEN_ENH_I18N _XOPEN_IOV_MAX
554 _XOPEN_LEGACY   _XOPEN_NAME_MAX
555 _XOPEN_PATH_MAX _XOPEN_SHM
556 _XOPEN_STREAMS  _XOPEN_VERSION
557 _XOPEN_XCU_VERSION      _XOPEN_XPG2
558 _XOPEN_XPG3     _XOPEN_XPG4
563 The symbol \fBPATH\fR also is recognized, yielding the same value as the
564 \fBconfstr()\fR name value \fBCS_PATH\fR.
565 .SH EXAMPLES
567 \fBExample 1 \fRWriting the Value of a Variable
570 This example illustrates the value of \fB{NGROUPS_MAX}:\fR
573 .in +2
575 example% \fBgetconf NGROUPS_MAX\fR
577 .in -2
581 \fBExample 2 \fRWriting the Value of a Variable for a Specific Directory
584 This example illustrates the value of \fBNAME_MAX\fR for a specific directory:
587 .in +2
589 example% \fBgetconf NAME_MAX /usr\fR
591 .in -2
595 \fBExample 3 \fRDealing with Unspecified Results
598 This example shows how to deal more carefully with results that might be
599 unspecified:
602 .in +2
604 \fBif value=$(getconf PATH_MAX /usr); then
605 if [ "$value" = "undefined" ]; then
606 echo PATH_MAX in /usr is infinite.
607 else
608 echo PATH_MAX in /usr is $value.
610 else
611 echo Error in getconf.
612 fi\fR
614 .in -2
618 For example:
621 .in +2
623 \fBsysconf(_SC_POSIX_C_BIND);\fR
625 .in -2
632 .in +2
634 \fBsystem("getconf POSIX2_C_BIND");\fR
636 .in -2
640 in a C program could give different answers. The \fBsysconf\fR call supplies a
641 value that corresponds to the conditions when the program was either compiled
642 or executed, depending on the implementation. The \fBsystem\fR call to
643 \fBgetconf\fR always supplies a value corresponding to conditions when the
644 program is executed.
646 .SH ENVIRONMENT VARIABLES
649 See \fBenviron\fR(5) for descriptions of the following environment variables
650 that affect the execution of \fBgetconf\fR: \fBLANG\fR, \fBLC_ALL\fR,
651 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
654 The following environment variable is supported by the \fBksh93\fR built-in
655 \fBgetconf\fR command:
657 .ne 2
659 \fB\fB_AST_FEATURES\fR\fR
661 .RS 17n
662 Local writable values that are different from the default are stored in the
663 \fB_AST_FEATURES\fR environment variable. The \fB_AST_FEATURES\fR value is a
664 space-separated list of \fIname path value\fR 3-tuples, where \fIname\fR is the
665 system configuration name, \fIpath\fR is the corresponding path, \fB-\fR if no
666 path is applicable, and \fIvalue\fR is the system configuration value.
669 .SH EXIT STATUS
672 The following exit values are returned:
674 .ne 2
676 \fB\fB0\fR\fR
678 .RS 6n
679 The specified variable is valid and information about its current state was
680 written successfully.
684 .ne 2
686 \fB\fB>0\fR\fR
688 .RS 6n
689 An error occurred.
692 .SH ATTRIBUTES
695 See \fBattributes\fR(5) for descriptions of the following attributes:
696 .SS "/usr/bin/getconf"
701 box;
702 c | c
703 l | l .
704 ATTRIBUTE TYPE  ATTRIBUTE VALUE
706 Interface Stability     Committed
708 Standard        See \fBstandards\fR(5).
711 .SS "ksh93"
716 box;
717 c | c
718 l | l .
719 ATTRIBUTE TYPE  ATTRIBUTE VALUE
721 Interface Stability     See below.
726 The \fBksh93\fR built-in binding to \fB/bin\fR and \fB/usr/bin\fR is Volatile.
727 The built-in command-line interface is Committed.
728 .SH SEE ALSO
731 \fBksh93\fR(1), \fBsh\fR(1), \fBpathconf\fR(2), \fBsysinfo\fR(2),
732 \fBconfstr\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5),
733 \fBstandards\fR(5)