1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu)
7 .\" FIXME Many more values for 'name' are supported, some of which
8 .\" are documented under 'info confstr'.
9 .\" See <bits/confname.h> for the rest.
10 .\" These should all be added to this page.
11 .\" See also the POSIX.1-2001 specification of confstr()
13 .TH CONFSTR 3 2021-03-22 "Linux man-pages (unreleased)"
15 confstr \- get configuration dependent string variables
18 .RI ( libc ", " \-lc )
21 .B #include <unistd.h>
23 .BI "size_t confstr(int " "name" ", char *" buf ", size_t " len );
27 Feature Test Macro Requirements for glibc (see
28 .BR feature_test_macros (7)):
33 _POSIX_C_SOURCE >= 2 || _XOPEN_SOURCE
37 gets the value of configuration-dependent string variables.
41 argument is the system variable to be queried.
42 The following variables are supported:
44 .BR _CS_GNU_LIBC_VERSION " (GNU C library only; since glibc 2.3.2)"
45 A string which identifies the GNU C library version on this system
46 (e.g., "glibc 2.3.4").
48 .BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library only; since glibc 2.3.2)"
49 A string which identifies the POSIX implementation supplied by this
50 C library (e.g., "NPTL 2.3.4" or "linuxthreads\-0.10").
55 variable which indicates where all the POSIX.2 standard utilities can
64 copies the value of the string to
68 bytes if necessary, with a null byte (\(aq\e0\(aq) as terminator.
69 This can be detected by comparing the return value of
80 just returns the value as defined below.
84 is a valid configuration variable,
86 returns the number of bytes (including the terminating null byte)
87 that would be required to hold the entire value of that variable.
88 This value may be greater than
90 which means that the value in
96 is a valid configuration variable,
97 but that variable does not have a value, then
102 does not correspond to a valid configuration variable,
115 For an explanation of the terms used in this section, see
123 Interface Attribute Value
126 T} Thread safety MT-Safe
132 POSIX.1-2001, POSIX.1-2008.
134 The following code fragment determines the path where to find
135 the POSIX.2 system utilities:
142 n = confstr(_CS_PATH, NULL, (size_t) 0);
146 confstr(_CS_PATH, pathbuf, n);