1.\" 2.\" Copyright 2000 Massachusetts Institute of Technology 3.\" 4.\" Permission to use, copy, modify, and distribute this software and 5.\" its documentation for any purpose and without fee is hereby 6.\" granted, provided that both the above copyright notice and this 7.\" permission notice appear in all copies, that both the above 8.\" copyright notice and this permission notice appear in all 9.\" supporting documentation, and that the name of M.I.T. not be used 10.\" in advertising or publicity pertaining to distribution of the 11.\" software without specific, written prior permission. M.I.T. makes 12.\" no representations about the suitability of this software for any 13.\" purpose. It is provided "as is" without express or implied 14.\" warranty. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS 17.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE, 18.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT 20.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 23.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 26.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" SUCH DAMAGE. 28.\" 29.\" $FreeBSD: src/usr.bin/getconf/getconf.1,v 1.9.2.2 2003/02/25 20:31:18 trhodes Exp $ 30.\" $DragonFly: src/usr.bin/getconf/getconf.1,v 1.3 2004/03/11 12:28:57 hmp Exp $ 31.\" 32.Dd September 18, 2002 33.Dt GETCONF 1 34.Os 35.Sh NAME 36.Nm getconf 37.Nd retrieve standard configuration variables 38.Sh SYNOPSIS 39.Nm 40.Op Fl v Ar environment 41.Ar path_var 42.Ar file 43.Nm 44.Op Fl v Ar environment 45.Ar system_var 46.Sh DESCRIPTION 47The 48.Nm 49utility prints the value of a 50.Tn POSIX 51or 52.Tn X/Open 53path or system configuration variable to the standard output. 54If the specified variable is undefined, the string 55.Dq Li undefined 56is output. 57.Pp 58The first form of the command, with two mandatory 59arguments, retrieves file- and file system-specific 60configuration variables using 61.Xr pathconf 2 . 62The second form, with a single argument, retrieves system 63configuration variables using 64.Xr confstr 3 65and 66.Xr sysconf 3 , 67depending on the type of variable. 68As an extension, the second form can also be used to query static limits from 69.Aq Pa limits.h . 70.Pp 71All 72.Xr sysconf 3 73and 74.Xr pathconf 2 75variables use the same name as the manifest constants defined in 76the relevant standard C-language bindings, including any leading 77underscore or prefix. 78That is to say, 79.Ar system_var 80might be 81.Dv ARG_MAX 82or 83.Dv _POSIX_VERSION , 84as opposed to the 85.Xr sysconf 3 86names 87.Dv _SC_ARG_MAX 88or 89.Dv _SC_POSIX_VERSION . 90Variables retrieved from 91.Xr confstr 3 92have the leading 93.Ql _CS_ 94stripped off; thus, 95.Dv _CS_PATH 96is queried by a 97.Ar system_var 98of 99.Dq Li PATH . 100.Ss Programming Environments 101The 102.Fl v Ar environment 103option specifies a 104.St -p1003.1-2001 105programming environment under which the values are to be queried. 106This option currently does nothing, but may in the future be used 107to select between 32-bit and 64-bit execution environments on platforms 108which support both. 109Specifying an environment which is not supported on the current execution 110platform gives undefined results. 111.Pp 112The standard programming environments are as follows: 113.Bl -tag -width ".Li POSIX_V6_LPBIG_OFFBIG" -offset indent 114.It Li POSIX_V6_ILP32_OFF32 115Exactly 32-bit integer, long, pointer, and file offset. 116.Sy Supported platforms : 117None. 118.It Li POSIX_V6_ILP32_OFFBIG 119Exactly 32-bit integer, long, and pointer; at least 64-bit file offset. 120.Sy Supported platforms : 121.Tn IA32 , 122.Tn PowerPC . 123.It Li POSIX_V6_LP64_OFF64 124Exactly 32-bit integer; exactly 64-bit long, pointer, and file offset. 125.Sy Supported platforms : 126.Tn Alpha , 127.Tn SPARC64 . 128.It Li POSIX_V6_LPBIG_OFFBIG 129At least 32-bit integer; at least 64-bit long, pointer, and file offset. 130.Sy Supported platforms : 131None. 132.El 133.Pp 134The command: 135.Pp 136.Dl "getconf POSIX_V6_WIDTH_RESTRICTED_ENVS" 137.Pp 138returns a newline-separated list of environments in which the width 139of certain fundamental types is no greater than the width of the native 140C type 141.Vt long . 142At present, all programming environments supported by 143.Dx 144have this property. 145Several of the 146.Xr confstr 3 147variables provide information on the necessary compiler and linker flags 148to use the standard programming environments described above. 149.Sh DIAGNOSTICS 150.Ex -std 151Use of a 152.Ar system_var 153or 154.Ar path_var 155which is completely unrecognized is considered an error, 156causing a diagnostic message to be written to standard error. 157One 158which is known but merely undefined does not result in an error 159indication. 160The 161.Nm 162utility recognizes all of the variables defined for 163.St -p1003.1-2001 , 164including those which are not currently implemented. 165.Sh EXAMPLES 166The command: 167.Pp 168.Dl "getconf PATH" 169.Pp 170will display the system default setting for the 171.Ev PATH 172environment variable. 173.Pp 174The command: 175.Pp 176.Dl "getconf NAME_MAX /tmp" 177.Pp 178will display the maximum length of a filename in the 179.Pa /tmp 180directory. 181.Pp 182The command: 183.Pp 184.Dl "getconf -v POSIX_V6_LPBIG_OFFBIG LONG_MAX" 185.Pp 186will display the maximum value of the C type 187.Vt long 188in the 189.Li POSIX_V6_LPBIG_OFFBIG 190programming environment, 191if the system supports that environment. 192.Sh SEE ALSO 193.Xr pathconf 2 , 194.Xr confstr 3 , 195.Xr sysconf 3 196.Sh STANDARDS 197The 198.Nm 199utility is expected to be compliant with 200.St -p1003.1-2001 . 201.Sh HISTORY 202The 203.Nm 204utility first appeared in 205.Fx 5.0 . 206.Sh AUTHORS 207.An Garrett A. Wollman Aq wollman@lcs.mit.edu 208