xref: /freebsd/usr.bin/getconf/getconf.1 (revision b52b9d56d4e96089873a75f9e29062eec19fabba)
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$
30.\"
31.Dd April 25, 2000
32.Dt GETCONF 1
33.Os
34.Sh NAME
35.Nm getconf
36.Nd retrieve standard configuration variables
37.Sh SYNOPSIS
38.Nm
39.Op Fl v Ar environment
40.Ar path_var
41.Ar file
42.Pp
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 filesystem-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.
68.Pp
69All variables use the same name as the manifest constants defined in
70the relevant standard C-language bindings, including any leading
71underscore or prefix.
72That is to say,
73.Ar system_var
74might be
75.Dv ARG_MAX
76or
77.Dv _POSIX_VERSION ,
78as opposed to the
79.Xr sysconf 3
80names
81.Dv _SC_ARG_MAX
82or
83.Dv _SC_POSIX_VERSION .
84(There is one exception: there is no corresponding manifest constant
85to
86.Dv _CS_PATH ,
87so a
88.Ar system_var
89of
90.Dq Li PATH
91is used.)
92.Pp
93The
94.Fl v Ar environment
95option is not supported, but provided for compatibility purposes.
96.Sh DIAGNOSTICS
97.Ex -std
98Use of a
99.Ar system_var
100or
101.Ar path_var
102which is completely unknown to the system is considered an error,
103causing a diagnostic message to be written to standard error; one
104which is known but merely undefined does not result in an error
105indication.
106.Pp
107Use of the unsupported
108.Fl v Ar environment
109option will result in a diagnostic message indicating that it is not
110supported.
111.Sh EXAMPLES
112The command:
113.Bd -literal -offset indent
114getconf PATH
115.Ed
116.Pp
117will display the system default setting for the
118.Ev PATH
119environment variable.
120.Pp
121The command:
122.Bd -literal -offset indent
123getconf NAME_MAX /tmp
124.Ed
125.Pp
126will display the maximum length of a filename in the
127.Pa /tmp
128directory.
129.Sh SEE ALSO
130.Xr pathconf 2 ,
131.Xr confstr 3 ,
132.Xr sysconf 3
133.Sh STANDARDS
134The
135.Nm
136utility is expected to be compliant with
137.St -susv2 .
138.Sh HISTORY
139The
140.Nm
141command first appeared in
142.Fx 5.0 .
143.Sh AUTHORS
144.An Garrett A. Wollman Aq wollman@lcs.mit.edu
145