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.\" 318c6bd995SGarrett Wollman.Dd April 25, 2000 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 428c6bd995SGarrett Wollman.Pp 438fe908efSRuslan Ermilov.Nm 448c6bd995SGarrett Wollman.Op Fl v Ar environment 458c6bd995SGarrett Wollman.Ar system_var 468c6bd995SGarrett Wollman.Sh DESCRIPTION 478c6bd995SGarrett WollmanThe 488fe908efSRuslan Ermilov.Nm 4904662725SGarrett Wollmanutility prints the value of a 508c6bd995SGarrett Wollman.Tn POSIX 518c6bd995SGarrett Wollmanor 528c6bd995SGarrett Wollman.Tn X/Open 53d75f6037SGarrett Wollmanpath or system configuration variable to the standard output. 548c6bd995SGarrett WollmanIf the specified variable is undefined, the string 558c6bd995SGarrett Wollman.Dq Li undefined 568c6bd995SGarrett Wollmanis output. 578c6bd995SGarrett Wollman.Pp 588c6bd995SGarrett WollmanThe first form of the command, with two mandatory 598c6bd995SGarrett Wollmanarguments, retrieves file- and filesystem-specific 608c6bd995SGarrett Wollmanconfiguration variables using 618c6bd995SGarrett Wollman.Xr pathconf 2 . 628c6bd995SGarrett WollmanThe second form, with a single argument, retrieves system 638c6bd995SGarrett Wollmanconfiguration variables using 648c6bd995SGarrett Wollman.Xr confstr 3 658c6bd995SGarrett Wollmanand 668c6bd995SGarrett Wollman.Xr sysconf 3 , 678c6bd995SGarrett Wollmandepending on the type of variable. 688c6bd995SGarrett Wollman.Pp 698c6bd995SGarrett WollmanAll variables use the same name as the manifest constants defined in 708c6bd995SGarrett Wollmanthe relevant standard C-language bindings, including any leading 718c6bd995SGarrett Wollmanunderscore or prefix. 728c6bd995SGarrett WollmanThat is to say, 738c6bd995SGarrett Wollman.Ar system_var 748c6bd995SGarrett Wollmanmight be 758c6bd995SGarrett Wollman.Dv ARG_MAX 768c6bd995SGarrett Wollmanor 778c6bd995SGarrett Wollman.Dv _POSIX_VERSION , 788c6bd995SGarrett Wollmanas opposed to the 798c6bd995SGarrett Wollman.Xr sysconf 3 808c6bd995SGarrett Wollmannames 818c6bd995SGarrett Wollman.Dv _SC_ARG_MAX 828c6bd995SGarrett Wollmanor 838c6bd995SGarrett Wollman.Dv _SC_POSIX_VERSION . 848c6bd995SGarrett Wollman(There is one exception: there is no corresponding manifest constant 858c6bd995SGarrett Wollmanto 868c6bd995SGarrett Wollman.Dv _CS_PATH , 878c6bd995SGarrett Wollmanso a 888c6bd995SGarrett Wollman.Ar system_var 898c6bd995SGarrett Wollmanof 908c6bd995SGarrett Wollman.Dq Li PATH 918c6bd995SGarrett Wollmanis used.) 928c6bd995SGarrett Wollman.Pp 938c6bd995SGarrett WollmanThe 948c6bd995SGarrett Wollman.Fl v Ar environment 958c6bd995SGarrett Wollmanoption is not supported, but provided for compatibility purposes. 968c6bd995SGarrett Wollman.Sh DIAGNOSTICS 97d628d776SRuslan Ermilov.Ex -std 988c6bd995SGarrett WollmanUse of a 998c6bd995SGarrett Wollman.Ar system_var 1008c6bd995SGarrett Wollmanor 1018c6bd995SGarrett Wollman.Ar path_var 1028c6bd995SGarrett Wollmanwhich is completely unknown to the system is considered an error, 1038c6bd995SGarrett Wollmancausing a diagnostic message to be written to standard error; one 1048c6bd995SGarrett Wollmanwhich is known but merely undefined does not result in an error 1058c6bd995SGarrett Wollmanindication. 1068c6bd995SGarrett Wollman.Pp 1078c6bd995SGarrett WollmanUse of the unsupported 1088c6bd995SGarrett Wollman.Fl v Ar environment 1098c6bd995SGarrett Wollmanoption will result in a diagnostic message indicating that it is not 1108c6bd995SGarrett Wollmansupported. 1118c6bd995SGarrett Wollman.Sh EXAMPLES 1128c6bd995SGarrett WollmanThe command: 1138c6bd995SGarrett Wollman.Bd -literal -offset indent 1148c6bd995SGarrett Wollmangetconf PATH 1158c6bd995SGarrett Wollman.Ed 1168c6bd995SGarrett Wollman.Pp 1178c6bd995SGarrett Wollmanwill display the system default setting for the 1188c6bd995SGarrett Wollman.Ev PATH 1198c6bd995SGarrett Wollmanenvironment variable. 1208c6bd995SGarrett Wollman.Pp 1218c6bd995SGarrett WollmanThe command: 1228c6bd995SGarrett Wollman.Bd -literal -offset indent 1238c6bd995SGarrett Wollmangetconf NAME_MAX /tmp 1248c6bd995SGarrett Wollman.Ed 1258c6bd995SGarrett Wollman.Pp 1268c6bd995SGarrett Wollmanwill display the maximum length of a filename in the 1278c6bd995SGarrett Wollman.Pa /tmp 1288c6bd995SGarrett Wollmandirectory. 1298c6bd995SGarrett Wollman.Sh SEE ALSO 1308c6bd995SGarrett Wollman.Xr pathconf 2 , 1315521ff5aSRuslan Ermilov.Xr confstr 3 , 1328c6bd995SGarrett Wollman.Xr sysconf 3 1338c6bd995SGarrett Wollman.Sh STANDARDS 1348c6bd995SGarrett WollmanThe 1358fe908efSRuslan Ermilov.Nm 1368c6bd995SGarrett Wollmanutility is expected to be compliant with 1378c6bd995SGarrett Wollman.St -susv2 . 1388c6bd995SGarrett Wollman.Sh HISTORY 1398c6bd995SGarrett WollmanThe 1408fe908efSRuslan Ermilov.Nm 1418c6bd995SGarrett Wollmancommand first appeared in 1428c6bd995SGarrett Wollman.Fx 5.0 . 143251c176fSRuslan Ermilov.Sh AUTHORS 1448c6bd995SGarrett Wollman.An Garrett A. Wollman Aq wollman@lcs.mit.edu 145