xref: /netbsd-src/usr.bin/getconf/getconf.1 (revision cdd0abcf1b756d885aad4a3f3e6574b4d1a4a0bd)
1.\"	$NetBSD: getconf.1,v 1.14 2024/02/18 19:35:38 jkoshy Exp $
2.\"
3.\" Copyright (c) 1996 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by J.T. Conklin.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd February 18, 2024
31.Dt GETCONF 1
32.Os
33.Sh NAME
34.Nm getconf
35.Nd get configuration values
36.Sh SYNOPSIS
37.Nm
38.Ar system_var
39.Nm
40.Ar path_var
41.Ar pathname
42.Nm
43.Fl a Op Ar pathname
44.Sh DESCRIPTION
45The
46.Nm
47utility writes the current value of a configurable system limit or
48option variable to the standard output.
49.Pp
50The
51.Ar system_var
52argument specifies the system variable to be queried.
53The names of the system variables are from
54.Xr sysconf 3
55with the leading
56.Dq Li _SC_
57removed.
58.Pp
59The
60.Ar path_var
61argument specifies the pathname variable to be queried for the specified
62.Ar pathname
63argument.
64The names of the pathname variables are from
65.Xr pathconf 2
66with the leading
67.Dq Li _PC_
68removed.
69.Pp
70When invoked with the option
71.Fl a ,
72.Nm
73writes a list of all applicable variables and their values to the
74standard output, in the format
75.Do
76.Va name
77=
78.Va value
79.Dc .
80.Pp
81For compatibility with other operating systems,
82.Nm
83will ignore leading underscores in the names specified in the
84.Ar system_var
85and
86.Ar path_var
87arguments.
88.Sh EXIT STATUS
89.Ex -std
90.Sh EXAMPLES
91To retrieve the number of configured processors, use:
92.Bd -literal -offset indent
93$ getconf NPROCESSORS_CONF
94.Ed
95.Pp
96To retrieve the maximum number of bytes (excluding the trailing
97.Dv NUL )
98for a filename in the current directory, use:
99.Bd -literal -offset indent
100$ getconf NAME_MAX .
101.Ed
102.Sh SEE ALSO
103.Xr pathconf 2 ,
104.Xr confstr 3 ,
105.Xr limits 3 ,
106.Xr sysconf 3
107.Sh STANDARDS
108The
109.Nm
110utility conforms to
111.St -p1003.2-92 .
112