2 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" Modified Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu)
8 .\" FIXME Many more values for 'name' are supported, some of which
9 .\" are documented under 'info libc confstr'.
10 .\" See <bits/confname.h> for the rest.
11 .\" These should all be added to this page.
12 .\" See also the POSIX.1-2001 specification of confstr()
14 .TH confstr 3 (date) "Linux man-pages (unreleased)"
16 confstr \- get configuration dependent string variables
19 .RI ( libc ", " \-lc )
22 .B #include <unistd.h>
24 .BI "size_t confstr(int " "name" ", char " buf [. size "], size_t " size );
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
34 _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE
38 gets the value of configuration-dependent string variables.
42 argument is the system variable to be queried.
43 The following variables are supported:
45 .BR _CS_GNU_LIBC_VERSION " (GNU C library only; since glibc 2.3.2)"
46 A string which identifies the GNU C library version on this system
47 (e.g., "glibc 2.3.4").
49 .BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library only; since glibc 2.3.2)"
50 A string which identifies the POSIX implementation supplied by this
51 C library (e.g., "NPTL 2.3.4" or "linuxthreads\-0.10").
56 variable which indicates where all the POSIX.2 standard utilities can
65 copies the value of the string to
69 bytes if necessary, with a null byte (\(aq\e0\(aq) as terminator.
70 This can be detected by comparing the return value of
81 just returns the value as defined below.
85 is a valid configuration variable,
87 returns the number of bytes (including the terminating null byte)
88 that would be required to hold the entire value of that variable.
89 This value may be greater than
91 which means that the value in
97 is a valid configuration variable,
98 but that variable does not have a value, then
103 does not correspond to a valid configuration variable,
116 For an explanation of the terms used in this section, see
124 Interface Attribute Value
127 T} Thread safety MT-Safe
133 POSIX.1-2001, POSIX.1-2008.
135 The following code fragment determines the path where to find
136 the POSIX.2 system utilities:
143 n = confstr(_CS_PATH, NULL, (size_t) 0);
147 confstr(_CS_PATH, pathbuf, n);