2 .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved
3 .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
4 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
6 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
7 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
8 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
9 .\" This notice shall appear on any product containing this material.
10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
11 .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
12 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
13 .TH GETCONF 1 "Sep 27, 2013"
15 getconf \- get configuration values
17 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf"
20 \fB/usr/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR
25 \fB/usr/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR
30 \fB/usr/bin/getconf\fR \fB-a\fR
35 \fB/usr/xpg4/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR
40 \fB/usr/xpg4/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR
45 \fB/usr/xpg4/bin/getconf\fR \fB-a\fR
50 \fB/usr/xpg6/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIsystem_var\fR
55 \fB/usr/xpg6/bin/getconf\fR [\fB-v\fR \fIspecification\fR] \fIpath_var\fR \fIpathname\fR
60 \fB/usr/xpg6/bin/getconf\fR \fB-a\fR
66 \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 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf"
73 In the first synopsis form, the \fBgetconf\fR utility writes to the standard
74 output the value of the variable specified by \fIsystem_var\fR, in accordance
75 with \fIspecification\fR if the \fB-v\fR option is used.
78 In the second synopsis form, \fBgetconf\fR writes to the standard output the
79 value of the variable specified by \fIpath_var\fR for the path specified by
80 \fIpathname\fR, in accordance with \fIspecification\fR if the \fB-v\fR option
84 In the third synopsis form, \fBconfig\fR writes to the standard output the
85 names of the current system configuration variables.
88 The value of each configuration variable is determined as if it were obtained
89 by calling the function from which it is defined to be available. The value
90 reflects conditions in the current operating environment.
94 The \fBgetconf\fR built-in in \fBksh93\fR is associated with the \fB/bin\fR and
95 \fB/usr/bin\fR paths. It is invoked when \fBgetconf\fR is executed without a
96 pathname prefix and the pathname search finds a \fB/bin/getconf\fR or
97 \fB/usr/bin/getconf\fR executable.
100 \fBgetconf\fR displays the system configuration value for \fIname\fR. If
101 \fIname\fR is a filesystem specific variable, the value is determined relative
102 to path, or, the current directory, if path is omitted. If \fIvalue\fR is
103 specified, \fBgetconf\fR attempts to change the process local value to
104 \fIvalue\fR. \fB-\fR can be used in place of path when it is not relevant. Only
105 writable variables can be set. \fBreadonly\fR variables cannot be changed.
108 The current value for \fIname\fR is written to the standard output. If
109 \fIname\fR is valid but undefined, \fBundefined\fR is written to the standard
110 output. If \fIname\fR is invalid or an error occurs in determining its value, a
111 diagnostic is written to standard error and \fBgetconf\fR exits with a
112 \fBnon-zero\fR exit status.
115 More than one variable can be set or queried by providing the \fIname path
116 value\fR 3-tuple for each variable, specifying \fB-\fR for value when querying.
119 If no operands are specified, all known variables are written in
120 \fIname\fR\fB=\fR\fIvalue\fR form to the standard output, one per line. Only
121 one of \fB--call\fR, \fB--name\fR or \fB--standard\fR can be specified.
123 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf"
126 The following options are supported by \fB/usr/bin/getconf\fR,
127 \fB/usr/xpg4/bin/getconf\fR, and \fB/usr/xpg6/bin/getconf\fR
134 Writes the names of the current system configuration variables to the standard
141 \fB\fB-v\fR\fIspecification\fR\fR
144 Gives the specification which governs the selection of values for configuration
151 The following options are supported by the \fBgetconf\fR built-in command in
163 Call the native \fBgetconf -a\fR.
176 List base variable name without \fBcall\fR and standard prefixes.
186 \fB\fB--call=\fR\fIRE\fR\fR
189 Display variables with \fBcall\fR prefix that matches \fIRE\fR. The \fBcall\fR
240 \fB\fB--defined\fR\fR
243 Only display defined values when no operands are specified.
253 \fB\fB--lowercase\fR\fR
256 List variable names in lower case.
266 \fB\fB--name=\fR\fIRE\fR\fR
269 Display variables with names that match \fIRE\fR.
279 \fB\fB--portable\fR\fR
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.
297 Quote values (\fB"..."\fR).
307 \fB\fB--readonly\fR\fR
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.
321 \fB\fB--standard=\fR\fIRE\fR\fR
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:
357 Display the internal table that contains the name, standard, standard section,
358 and system call symbol prefix for each variable.
368 \fB\fB--writable\fR\fR
371 Display the named writable variables in \fIname\fR\fB=\fR\fIvalue\fR form. If
372 \fIname\fR is omitted, lists all writable variables.
382 \fB\fB--specification=name\fR\fR
385 Call the native \fBgetconf -v\fR \fIname\fR.
389 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf"
392 The following operands are supported by \fB/usr/bin/getconf\fR,
393 \fB/usr/xpg4/bin/getconf\fR, and \fB/usr/xpg6/bin/getconf\fR:
400 A name of a configuration variable whose value is available from the
401 \fBpathconf\fR(2) function. All of the values in the following table are
411 ACL_ENABLED NAME_MAX XATTR_ENABLED
412 LINK_MAX PATH_MAX XATTR_EXISTS
413 MAX_CANON PIPE_BUF _POSIX_CHOWN_RESTRICTED
414 MAX_INPUT SATTR_ENABLED _POSIX_NO_TRUNC
415 MIN_HOLE_SIZE SATTR_EXISTS _POSIX_VDISABLE
424 A path name for which the variable specified by \fIpath_var\fR is to be
431 \fB\fIsystem_var\fR\fR
434 A name of a configuration variable whose value is available from
435 \fBconfstr\fR(3C) or \fBsysconf\fR(3C). All of the values in the following
446 BC_DIM_MAX BC_SCALE_MAX
447 BC_STRING_MAX CHAR_BIT
448 CHARCLASS_NAME_MAX CHAR_MAX
450 CLK_TCK COLL_WEIGHTS_MAX
451 CS_PATH EXPR_NEST_MAX
452 HOST_NAME_MAX INT_MAX
454 LFS64_LDFLAGS LFS64_LIBS
455 LFS64_LINTFLAGS LFS_CFLAGS
457 LFS_LINTFLAGS LINE_MAX
460 NGROUPS_MAX NL_ARGMAX
463 NL_TEXTMAX NPROCESSORS_CONF
464 NPROCESSORS_MAX NPROCESSORS_ONLN
466 POSIX2_BC_BASE_MAX POSIX2_BC_DIM_MAX
467 POSIX2_BC_SCALE_MAX POSIX2_BC_STRING_MAX
468 POSIX2_C_BIND POSIX2_C_DEV
469 POSIX2_CHAR_TERM POSIX2_COLL_WEIGHTS_MAX
470 POSIX2_C_VERSION POSIX2_EXPR_NEST_MAX
471 POSIX2_FORT_DEV POSIX2_FORT_RUN
472 POSIX2_LINE_MAX POSIX2_LOCALEDEF
473 POSIX2_RE_DUP_MAX POSIX2_SW_DEV
474 POSIX2_SYMLINKS POSIX2_UPE
475 POSIX2_VERSION POSIX_ALLOC_SIZE_MIN
476 POSIX_REC_INCR_XFER_SIZE POSIX_REC_MAX_XFER_SIZE
477 POSIX_REC_MIN_XFER_SIZE POSIX_REC_XFER_ALIGN
478 POSIX_V6_ILP32_OFF32 POSIX_V6_ILP32_OFF32_CFLAGS
479 POSIX_V6_ILP32_OFF32_LDFLAGS POSIX_V6_ILP32_OFF32_LIBS
480 POSIX_V6_ILP32_OFFBIG POSIX_V6_ILP32_OFFBIG_CFLAGS
481 POSIX_V6_ILP32_OFFBIG_LDFLAGS POSIX_V6_ILP32_OFFBIG_LIBS
482 POSIX_V6_LP64_OFF64 POSIX_V6_LP64_OFF64_CFLAGS
483 POSIX_V6_LP64_OFF64_LDFLAGS POSIX_V6_LP64_OFF64_LIBS
484 POSIX_V6_LPBIG_OFFBIG POSIX_V6_LPBIG_OFFBIG_CFLAGS
485 POSIX_V6_LPBIG_OFFBIG_LDFLAGS POSIX_V6_LPBIG_OFFBIG_LIBS
486 POSIX_V6_WIDTH_RESTRICTED_ENVS SYMLINK_MAX
487 SYMLOOP_MAX _POSIX2_BC_BASE_MAX
488 _POSIX2_BC_DIM_MAX _POSIX2_BC_SCALE_MAX
489 _POSIX2_BC_STRING_MAX _POSIX2_CHARCLASS_NAME_MAX
490 _POSIX2_CHAR_TERM _POSIX2_COLL_WEIGHTS_MAX
491 _POSIX2_C_BIND _POSIX2_C_DEV
492 _POSIX2_C_VERSION _POSIX2_EXPR_NEST_MAX
493 _POSIX2_FORT_DEV _POSIX2_FORT_RUN
494 _POSIX2_LINE_MAX _POSIX2_LOCALEDEF
495 _POSIX2_PBS _POSIX2_PBS_ACCOUNTING
496 _POSIX2_PBS_CHECKPOINT _POSIX2_PBS_LOCATE
497 _POSIX2_PBS_MESSAGE _POSIX2_PBS_TRACK
498 _POSIX2_RE_DUP_MAX _POSIX2_SW_DEV
499 _POSIX2_UPE _POSIX2_VERSION
500 _POSIX_ADVISORY_INFO _POSIX_AIO_LISTIO_MAX
501 _POSIX_AIO_MAX _POSIX_ARG_MAX
502 _POSIX_ASYNC_IO _POSIX_BARRIERS
503 _POSIX_CHILD_MAX _POSIX_CLOCKRES_MIN
504 _POSIX_CLOCK_SELECTION _POSIX_CPUTIME
505 _POSIX_DELAYTIMER_MAX _POSIX_HOST_NAME_MAX
506 _POSIX_IPV6 _POSIX_JOB_CONTROL
507 _POSIX_LINK_MAX _POSIX_LOGIN_NAME_MAX
508 _POSIX_MAX_CANON _POSIX_MAX_INPUT
509 _POSIX_MONOTONIC_CLOCK _POSIX_MQ_OPEN_MAX
510 _POSIX_MQ_PRIO_MAX _POSIX_NAME_MAX
511 _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX
512 _POSIX_PATH_MAX _POSIX_PIPE_BUF
513 _POSIX_PRIO_IO _POSIX_RAW_SOCKETS
514 _POSIX_READER_WRITER_LOCKS _POSIX_REGEXP
515 _POSIX_RE_DUP_MAX _POSIX_RTSIG_MAX
516 _POSIX_SAVED_IDS _POSIX_SEM_NSEMS_MAX
517 _POSIX_SEM_VALUE_MAX _POSIX_SHELL
518 _POSIX_SIGQUEUE_MAX _POSIX_SPAWN
519 _POSIX_SPIN_LOCKS _POSIX_SPORADIC_SERVER
520 _POSIX_SSIZE_MAX _POSIX_SS_REPL_MAX
521 _POSIX_STREAM_MAX _POSIX_SYMLINK_MAX
522 _POSIX_SYMLOOP_MAX _POSIX_SYNC_IO
523 _POSIX_THREAD_ATTR_STACKADDR _POSIX_THREAD_ATTR_STACKSIZE
524 _POSIX_THREAD_CPUTIME _POSIX_THREAD_DESTRUCTOR_ITERATIONS
525 _POSIX_THREAD_KEYS_MAX _POSIX_THREAD_PRIORITY_SCHEDULING
526 _POSIX_THREAD_PRIO_INHERIT _POSIX_THREAD_PRIO_PROTECT
527 _POSIX_THREAD_PROCESS_SHARED _POSIX_THREAD_SAFE_FUNCTIONS
528 _POSIX_THREAD_SPORADIC_SERVER _POSIX_THREAD_THREADS_MAX
529 _POSIX_TIMEOUTS _POSIX_TIMER_MAX
530 _POSIX_TRA_POSIX_TIMER_MAXCE _POSIX_TIMESTAMP_RESOLUTION
531 _POSIX_TRACE_EVENT_FILTER _POSIX_TRACE_EVENT_NAME_MAX
532 _POSIX_TRACE_INHERIT _POSIX_TRACE_LOG
533 _POSIX_TRACE_NAME_MAX _POSIX_TRACE_SYS_MAX
534 _POSIX_TRACE_USER_EVENT_MAX _POSIX_TTY_NAME_MAX
535 _POSIX_TYPED_MEMORY_OBJECTS _POSIX_TZNAME_MAX
536 _POSIX_VERSION _POSIX_V6_ILP32_OFF32
537 _POSIX_V6_ILP32_OFFBIG _POSIX_V6_LP64_OFF64
538 _POSIX_V6_LPBIG_OFFBIG _V6_ILP32_OFF32
539 _V6_ILP32_OFFBIG _V6_LP64_OFF64
540 _V6_LPBIG_OFFBIG RE_DUP_MAX
547 WORD_BIT XBS5_ILP32_OFF32
548 XBS5_ILP32_OFF32_CFLAGS XBS5_ILP32_OFF32_LDFLAGS
549 XBS5_ILP32_OFF32_LIBS XBS5_ILP32_OFF32_LINTFLAGS
550 XBS5_ILP32_OFFBIG XBS5_ILP32_OFFBIG_CFLAGS
551 XBS5_ILP32_OFFBIG_LDFLAGS XBS5_ILP32_OFFBIG_LIBS
552 XBS5_ILP32_OFFBIG_LINTFLAGS XBS5_LP64_OFF64
553 XBS5_LP64_OFF64_CFLAGS XBS5_LP64_OFF64_LDFLAGS
554 XBS5_LP64_OFF64_LIBS XBS5_LP64_OFF64_LINTFLAGS
555 XBS5_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG_CFLAGS
556 XBS5_LPBIG_OFFBIG_LDFLAGS XBS5_LPBIG_OFFBIG_LIBS
557 XBS5_LPBIG_OFFBIG_LINTFLAGS _XOPEN_CRYPT
558 _XOPEN_ENH_I18N _XOPEN_IOV_MAX
559 _XOPEN_LEGACY _XOPEN_NAME_MAX
560 _XOPEN_PATH_MAX _XOPEN_SHM
561 _XOPEN_STREAMS _XOPEN_VERSION
562 _XOPEN_XCU_VERSION _XOPEN_XPG2
563 _XOPEN_XPG3 _XOPEN_XPG4
568 The symbol \fBPATH\fR also is recognized, yielding the same value as the
569 \fBconfstr()\fR name value \fBCS_PATH\fR.
573 See \fBlargefile\fR(5) for the description of the behavior of
574 \fB/usr/bin/getconf\fR when encountering files greater than or equal to 2 Gbyte
578 \fBExample 1 \fRWriting the Value of a Variable
581 This example illustrates the value of \fB{NGROUPS_MAX}:\fR
586 example% \fBgetconf NGROUPS_MAX\fR
592 \fBExample 2 \fRWriting the Value of a Variable for a Specific Directory
595 This example illustrates the value of \fBNAME_MAX\fR for a specific directory:
600 example% \fBgetconf NAME_MAX /usr\fR
606 \fBExample 3 \fRDealing with Unspecified Results
609 This example shows how to deal more carefully with results that might be
615 \fBif value=$(getconf PATH_MAX /usr); then
616 if [ "$value" = "undefined" ]; then
617 echo PATH_MAX in /usr is infinite.
619 echo PATH_MAX in /usr is $value.
622 echo Error in getconf.
634 \fBsysconf(_SC_POSIX_C_BIND);\fR
645 \fBsystem("getconf POSIX2_C_BIND");\fR
651 in a C program could give different answers. The \fBsysconf\fR call supplies a
652 value that corresponds to the conditions when the program was either compiled
653 or executed, depending on the implementation. The \fBsystem\fR call to
654 \fBgetconf\fR always supplies a value corresponding to conditions when the
657 .SH ENVIRONMENT VARIABLES
660 See \fBenviron\fR(5) for descriptions of the following environment variables
661 that affect the execution of \fBgetconf\fR: \fBLANG\fR, \fBLC_ALL\fR,
662 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
665 The following environment variable is supported by the \fBksh93\fR built-in
666 \fBgetconf\fR command:
670 \fB\fB_AST_FEATURES\fR\fR
673 Local writable values that are different from the default are stored in the
674 \fB_AST_FEATURES\fR environment variable. The \fB_AST_FEATURES\fR value is a
675 space-separated list of \fIname path value\fR 3-tuples, where \fIname\fR is the
676 system configuration name, \fIpath\fR is the corresponding path, \fB-\fR if no
677 path is applicable, and \fIvalue\fR is the system configuration value.
683 The following exit values are returned:
690 The specified variable is valid and information about its current state was
691 written successfully.
706 See \fBattributes\fR(5) for descriptions of the following attributes:
707 .SS "/usr/bin/getconf, /usr/xpg4/bin/getconf, /usr/xpg6/bin/getconf"
715 ATTRIBUTE TYPE ATTRIBUTE VALUE
717 Interface Stability Committed
719 Standard See \fBstandards\fR(5).
730 ATTRIBUTE TYPE ATTRIBUTE VALUE
732 Interface Stability See below.
737 The \fBksh93\fR built-in binding to \fB/bin\fR and \fB/usr/bin\fR is Volatile.
738 The built-in command-line interface is Committed.
742 \fBksh93\fR(1), \fBsh\fR(1), \fBpathconf\fR(2), \fBsysinfo\fR(2),
743 \fBconfstr\fR(3C), \fBsysconf\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5),
744 \fBlargefile\fR(5), \fBstandards\fR(5)