18c6bd995SGarrett Wollman.\" 28c6bd995SGarrett Wollman.\" Copyright 2000 Massachusetts Institute of Technology 38c6bd995SGarrett Wollman.\" 48c6bd995SGarrett Wollman.\" Permission to use, copy, modify, and distribute this software and 58c6bd995SGarrett Wollman.\" its documentation for any purpose and without fee is hereby 68c6bd995SGarrett Wollman.\" granted, provided that both the above copyright notice and this 78c6bd995SGarrett Wollman.\" permission notice appear in all copies, that both the above 88c6bd995SGarrett Wollman.\" copyright notice and this permission notice appear in all 98c6bd995SGarrett Wollman.\" supporting documentation, and that the name of M.I.T. not be used 108c6bd995SGarrett Wollman.\" in advertising or publicity pertaining to distribution of the 118c6bd995SGarrett Wollman.\" software without specific, written prior permission. M.I.T. makes 128c6bd995SGarrett Wollman.\" no representations about the suitability of this software for any 138c6bd995SGarrett Wollman.\" purpose. It is provided "as is" without express or implied 148c6bd995SGarrett Wollman.\" warranty. 158c6bd995SGarrett Wollman.\" 168c6bd995SGarrett Wollman.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS 178c6bd995SGarrett Wollman.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, 188c6bd995SGarrett Wollman.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 198c6bd995SGarrett Wollman.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 208c6bd995SGarrett Wollman.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 218c6bd995SGarrett Wollman.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 228c6bd995SGarrett Wollman.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 238c6bd995SGarrett Wollman.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 248c6bd995SGarrett Wollman.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 258c6bd995SGarrett Wollman.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 268c6bd995SGarrett Wollman.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 278c6bd995SGarrett Wollman.\" SUCH DAMAGE. 288c6bd995SGarrett Wollman.\" 298c6bd995SGarrett Wollman.\" $FreeBSD$ 308c6bd995SGarrett Wollman.\" 31e9cfb9aeSGarrett Wollman.Dd September 18, 2002 328c6bd995SGarrett Wollman.Dt GETCONF 1 338c6bd995SGarrett Wollman.Os 348c6bd995SGarrett Wollman.Sh NAME 358c6bd995SGarrett Wollman.Nm getconf 368c6bd995SGarrett Wollman.Nd retrieve standard configuration variables 378c6bd995SGarrett Wollman.Sh SYNOPSIS 388fe908efSRuslan Ermilov.Nm 398c6bd995SGarrett Wollman.Op Fl v Ar environment 408c6bd995SGarrett Wollman.Ar path_var 418c6bd995SGarrett Wollman.Ar file 428fe908efSRuslan Ermilov.Nm 438c6bd995SGarrett Wollman.Op Fl v Ar environment 448c6bd995SGarrett Wollman.Ar system_var 458c6bd995SGarrett Wollman.Sh DESCRIPTION 468c6bd995SGarrett WollmanThe 478fe908efSRuslan Ermilov.Nm 4804662725SGarrett Wollmanutility prints the value of a 498c6bd995SGarrett Wollman.Tn POSIX 508c6bd995SGarrett Wollmanor 518c6bd995SGarrett Wollman.Tn X/Open 52d75f6037SGarrett Wollmanpath or system configuration variable to the standard output. 538c6bd995SGarrett WollmanIf the specified variable is undefined, the string 548c6bd995SGarrett Wollman.Dq Li undefined 558c6bd995SGarrett Wollmanis output. 568c6bd995SGarrett Wollman.Pp 578c6bd995SGarrett WollmanThe first form of the command, with two mandatory 588c6bd995SGarrett Wollmanarguments, retrieves file- and filesystem-specific 598c6bd995SGarrett Wollmanconfiguration variables using 608c6bd995SGarrett Wollman.Xr pathconf 2 . 618c6bd995SGarrett WollmanThe second form, with a single argument, retrieves system 628c6bd995SGarrett Wollmanconfiguration variables using 638c6bd995SGarrett Wollman.Xr confstr 3 648c6bd995SGarrett Wollmanand 658c6bd995SGarrett Wollman.Xr sysconf 3 , 668c6bd995SGarrett Wollmandepending on the type of variable. 67e9cfb9aeSGarrett WollmanAs an extension, the second form can also be used to query static limits from 68e9cfb9aeSGarrett Wollman.Aq Pa limits.h . 698c6bd995SGarrett Wollman.Pp 70e9cfb9aeSGarrett WollmanAll 71e9cfb9aeSGarrett Wollman.Xr sysconf 3 72e9cfb9aeSGarrett Wollmanand 73e9cfb9aeSGarrett Wollman.Xr pathconf 2 74e9cfb9aeSGarrett Wollmanvariables use the same name as the manifest constants defined in 758c6bd995SGarrett Wollmanthe relevant standard C-language bindings, including any leading 768c6bd995SGarrett Wollmanunderscore or prefix. 778c6bd995SGarrett WollmanThat is to say, 788c6bd995SGarrett Wollman.Ar system_var 798c6bd995SGarrett Wollmanmight be 808c6bd995SGarrett Wollman.Dv ARG_MAX 818c6bd995SGarrett Wollmanor 828c6bd995SGarrett Wollman.Dv _POSIX_VERSION , 838c6bd995SGarrett Wollmanas opposed to the 848c6bd995SGarrett Wollman.Xr sysconf 3 858c6bd995SGarrett Wollmannames 868c6bd995SGarrett Wollman.Dv _SC_ARG_MAX 878c6bd995SGarrett Wollmanor 888c6bd995SGarrett Wollman.Dv _SC_POSIX_VERSION . 89e9cfb9aeSGarrett WollmanVariables retrieved from 90e9cfb9aeSGarrett Wollman.Xr confstr 3 91e9cfb9aeSGarrett Wollmanhave the leading 92e9cfb9aeSGarrett Wollman.Ql _CS_ 93e9cfb9aeSGarrett Wollmanstripped off; thus, 94e9cfb9aeSGarrett Wollman.Dv _CS_PATH 95e9cfb9aeSGarrett Wollmanis queried by a 968c6bd995SGarrett Wollman.Ar system_var 978c6bd995SGarrett Wollmanof 98e9cfb9aeSGarrett Wollman.Dq Li PATH . 99e9cfb9aeSGarrett Wollman.Ss Programming Environments 1008c6bd995SGarrett WollmanThe 1018c6bd995SGarrett Wollman.Fl v Ar environment 102e9cfb9aeSGarrett Wollmanoption specifies a 103e9cfb9aeSGarrett Wollman.St -p1003.1-2001 104e9cfb9aeSGarrett Wollmanprogramming environment under which the values are to be queried. 105e9cfb9aeSGarrett WollmanThis option currently does nothing, but may in the future be used 106e9cfb9aeSGarrett Wollmanto select between 32-bit and 64-bit execution environments on platforms 107e9cfb9aeSGarrett Wollmanwhich support both. 108e9cfb9aeSGarrett WollmanSpecifying an environment which is not supported on the current execution 109e9cfb9aeSGarrett Wollmanplatform gives undefined results. 110e9cfb9aeSGarrett Wollman.Pp 111e9cfb9aeSGarrett WollmanThe standard programming environments are as follows: 112e9cfb9aeSGarrett Wollman.Bl -tag -width ".Li POSIX_V6_LPBIG_OFFBIG" -offset indent 113e9cfb9aeSGarrett Wollman.It Li POSIX_V6_ILP32_OFF32 114e9cfb9aeSGarrett WollmanExactly 32-bit integer, long, pointer, and file offset. 115e9cfb9aeSGarrett Wollman.Sy Supported platforms : 116e9cfb9aeSGarrett WollmanNone. 117e9cfb9aeSGarrett Wollman.It Li POSIX_V6_ILP32_OFFBIG 118e9cfb9aeSGarrett WollmanExactly 32-bit integer, long, and pointer; at least 64-bit file offset. 119e9cfb9aeSGarrett Wollman.Sy Supported platforms : 120e9cfb9aeSGarrett Wollman.Tn IA32 , 121e9cfb9aeSGarrett Wollman.Tn PowerPC . 122e9cfb9aeSGarrett Wollman.It Li POSIX_V6_LP64_OFF64 123e9cfb9aeSGarrett WollmanExactly 32-bit integer; exactly 64-bit long, pointer, and file offset. 124e9cfb9aeSGarrett Wollman.Sy Supported platforms : 125e9cfb9aeSGarrett Wollman.Tn Alpha , 126e9cfb9aeSGarrett Wollman.Tn SPARC64 . 127e9cfb9aeSGarrett Wollman.It Li POSIX_V6_LPBIG_OFFBIG 128e9cfb9aeSGarrett WollmanAt least 32-bit integer; at least 64-bit long, pointer, and file offset. 129e9cfb9aeSGarrett Wollman.Sy Supported platforms : 130e9cfb9aeSGarrett WollmanNone. 131e9cfb9aeSGarrett Wollman.El 132e9cfb9aeSGarrett Wollman.Pp 133e9cfb9aeSGarrett WollmanThe command: 1345bd97a95SRuslan Ermilov.Pp 1355bd97a95SRuslan Ermilov.Dl "getconf POSIX_V6_WIDTH_RESTRICTED_ENVS" 136e9cfb9aeSGarrett Wollman.Pp 137e9cfb9aeSGarrett Wollmanreturns a newline-separated list of environments in which the width 138e9cfb9aeSGarrett Wollmanof certain fundamental types is no greater than the width of the native 139e9cfb9aeSGarrett WollmanC type 1405bd97a95SRuslan Ermilov.Vt long . 141e9cfb9aeSGarrett WollmanAt present, all programming environments supported by 142e9cfb9aeSGarrett Wollman.Fx 143e9cfb9aeSGarrett Wollmanhave this property. 144e9cfb9aeSGarrett WollmanSeveral of the 145e9cfb9aeSGarrett Wollman.Xr confstr 3 146e9cfb9aeSGarrett Wollmanvariables provide information on the necessary compiler and linker flags 147e9cfb9aeSGarrett Wollmanto use the standard programming environments described above. 1488c6bd995SGarrett Wollman.Sh DIAGNOSTICS 149d628d776SRuslan Ermilov.Ex -std 1508c6bd995SGarrett WollmanUse of a 1518c6bd995SGarrett Wollman.Ar system_var 1528c6bd995SGarrett Wollmanor 1538c6bd995SGarrett Wollman.Ar path_var 154e9cfb9aeSGarrett Wollmanwhich is completely unrecognized is considered an error, 155e9cfb9aeSGarrett Wollmancausing a diagnostic message to be written to standard error. 156e9cfb9aeSGarrett WollmanOne 1578c6bd995SGarrett Wollmanwhich is known but merely undefined does not result in an error 1588c6bd995SGarrett Wollmanindication. 159e9cfb9aeSGarrett WollmanThe 160e9cfb9aeSGarrett Wollman.Nm 1615bd97a95SRuslan Ermilovutility recognizes all of the variables defined for 162e9cfb9aeSGarrett Wollman.St -p1003.1-2001 , 163e9cfb9aeSGarrett Wollmanincluding those which are not currently implemented. 1648c6bd995SGarrett Wollman.Sh EXAMPLES 1658c6bd995SGarrett WollmanThe command: 1665bd97a95SRuslan Ermilov.Pp 1675bd97a95SRuslan Ermilov.Dl "getconf PATH" 1688c6bd995SGarrett Wollman.Pp 1698c6bd995SGarrett Wollmanwill display the system default setting for the 1708c6bd995SGarrett Wollman.Ev PATH 1718c6bd995SGarrett Wollmanenvironment variable. 1728c6bd995SGarrett Wollman.Pp 1738c6bd995SGarrett WollmanThe command: 1745bd97a95SRuslan Ermilov.Pp 1755bd97a95SRuslan Ermilov.Dl "getconf NAME_MAX /tmp" 1768c6bd995SGarrett Wollman.Pp 1778c6bd995SGarrett Wollmanwill display the maximum length of a filename in the 1788c6bd995SGarrett Wollman.Pa /tmp 1798c6bd995SGarrett Wollmandirectory. 180e9cfb9aeSGarrett Wollman.Pp 181e9cfb9aeSGarrett WollmanThe command: 1825bd97a95SRuslan Ermilov.Pp 1835bd97a95SRuslan Ermilov.Dl "getconf -v POSIX_V6_LPBIG_OFFBIG LONG_MAX" 184e9cfb9aeSGarrett Wollman.Pp 185e9cfb9aeSGarrett Wollmanwill display the maximum value of the C type 1865bd97a95SRuslan Ermilov.Vt long 187e9cfb9aeSGarrett Wollmanin the 188e9cfb9aeSGarrett Wollman.Li POSIX_V6_LPBIG_OFFBIG 189e9cfb9aeSGarrett Wollmanprogramming environment, 190e9cfb9aeSGarrett Wollmanif the system supports that environment. 1918c6bd995SGarrett Wollman.Sh SEE ALSO 1928c6bd995SGarrett Wollman.Xr pathconf 2 , 1935521ff5aSRuslan Ermilov.Xr confstr 3 , 1948c6bd995SGarrett Wollman.Xr sysconf 3 1958c6bd995SGarrett Wollman.Sh STANDARDS 1968c6bd995SGarrett WollmanThe 1978fe908efSRuslan Ermilov.Nm 1988c6bd995SGarrett Wollmanutility is expected to be compliant with 199e9cfb9aeSGarrett Wollman.St -p1003.1-2001 . 2008c6bd995SGarrett Wollman.Sh HISTORY 2018c6bd995SGarrett WollmanThe 2028fe908efSRuslan Ermilov.Nm 2035bd97a95SRuslan Ermilovutility first appeared in 2048c6bd995SGarrett Wollman.Fx 5.0 . 205251c176fSRuslan Ermilov.Sh AUTHORS 2068c6bd995SGarrett Wollman.An Garrett A. Wollman Aq wollman@lcs.mit.edu 207