1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified Sat Jul 24 19:53:02 1993 by Rik Faith (faith@cs.unc.edu)
27 .\" FIXME Many more values for 'name' are supported, some of which
28 .\" are documented under 'info confstr'.
29 .\" See <bits/confname.h> for the rest.
30 .\" These should all be added to this page.
31 .\" See also the POSIX.1-2001 specification of confstr()
33 .TH CONFSTR 3 2019-03-06 "GNU" "Linux Programmer's Manual"
35 confstr \- get configuration dependent string variables
38 .B #include <unistd.h>
40 .BI "size_t confstr(int " "name" ", char *" buf ", size_t " len );
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
49 _POSIX_C_SOURCE\ >=\ 2 || _XOPEN_SOURCE
52 gets the value of configuration-dependent string variables.
56 argument is the system variable to be queried.
57 The following variables are supported:
59 .BR _CS_GNU_LIBC_VERSION " (GNU C library only; since glibc 2.3.2)"
60 A string which identifies the GNU C library version on this system
61 (e.g., "glibc 2.3.4").
63 .BR _CS_GNU_LIBPTHREAD_VERSION " (GNU C library only; since glibc 2.3.2)"
64 A string which identifies the POSIX implementation supplied by this
65 C library (e.g., "NPTL 2.3.4" or "linuxthreads-0.10").
70 variable which indicates where all the POSIX.2 standard utilities can
79 copies the value of the string to
83 bytes if necessary, with a null byte (\(aq\e0\(aq) as terminator.
84 This can be detected by comparing the return value of
95 just returns the value as defined below.
99 is a valid configuration variable,
101 returns the number of bytes (including the terminating null byte)
102 that would be required to hold the entire value of that variable.
103 This value may be greater than
105 which means that the value in
111 is a valid configuration variable,
112 but that variable does not have a value, then
117 does not correspond to a valid configuration variable,
130 For an explanation of the terms used in this section, see
136 Interface Attribute Value
139 T} Thread safety MT-Safe
142 POSIX.1-2001, POSIX.1-2008.
144 The following code fragment determines the path where to find
145 the POSIX.2 system utilities:
152 n = confstr(_CS_PATH, NULL, (size_t) 0);
156 confstr(_CS_PATH, pathbuf, n);