1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\" and Copyright (C) 2017 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Modified Wed Jul 28 11:12:26 1993 by Rik Faith (faith@cs.unc.edu)
28 .\" FIXME Probably all of the following should be documented:
34 .\" _PC_REC_INCR_XFER_SIZE,
35 .\" _PC_REC_MAX_XFER_SIZE,
36 .\" _PC_REC_MIN_XFER_SIZE,
37 .\" _PC_REC_XFER_ALIGN,
38 .\" _PC_ALLOC_SIZE_MIN,
42 .TH FPATHCONF 3 2021-03-22 "GNU" "Linux Programmer's Manual"
44 fpathconf, pathconf \- get configuration values for files
47 .B #include <unistd.h>
49 .BI "long fpathconf(int " fd ", int " name );
50 .BI "long pathconf(const char *" path ", int " name );
54 gets a value for the configuration option
56 for the open file descriptor
60 gets a value for configuration option
65 The corresponding macros defined in
67 are minimum values; if an application wants to take advantage of values
68 which may change, a call to
72 can be made, which may yield more liberal results.
76 equal to one of the following constants returns the following
77 configuration options:
80 The maximum number of links to the file.
85 refer to a directory, then the value applies to the whole directory.
86 The corresponding macro is
90 The maximum length of a formatted input line, where
94 must refer to a terminal.
95 The corresponding macro is
96 .BR _POSIX_MAX_CANON .
99 The maximum length of an input line, where
103 must refer to a terminal.
104 The corresponding macro is
105 .BR _POSIX_MAX_INPUT .
108 The maximum length of a filename in the directory
112 that the process is allowed to create.
113 The corresponding macro is
114 .BR _POSIX_NAME_MAX .
117 The maximum length of a relative pathname when
121 is the current working directory.
122 The corresponding macro is
123 .BR _POSIX_PATH_MAX .
126 The maximum number of bytes that can be written atomically to a pipe of FIFO.
130 should refer to a pipe or FIFO.
134 should refer to a FIFO or a directory; in the latter case,
135 the returned value corresponds to FIFOs created in that directory.
136 The corresponding macro is
137 .BR _POSIX_PIPE_BUF .
139 .B _PC_CHOWN_RESTRICTED
140 This returns a positive value if the use of
144 for changing a file's user ID is restricted to a process
145 with appropriate privileges,
146 and changing a file's group ID to a value other than the process's
147 effective group ID or one of its supplementary group IDs
148 is restricted to a process with appropriate privileges.
149 According to POSIX.1,
150 this variable shall always be defined with a value other than \-1.
151 The corresponding macro is
152 .BR _POSIX_CHOWN_RESTRICTED .
158 refers to a directory,
159 then the return value applies to all files in that directory.
162 This returns nonzero if accessing filenames longer than
165 The corresponding macro is
166 .BR _POSIX_NO_TRUNC .
169 This returns nonzero if special character processing can be disabled, where
173 must refer to a terminal.
175 The return value of these functions is one of the following:
177 On error, \-1 is returned and
179 is set to indicate the error
188 corresponds to a maximum or minimum limit, and that limit is indeterminate,
192 (To distinguish an indeterminate limit from an error, set
194 to zero before the call, and then check whether
196 is nonzero when \-1 is returned.)
200 corresponds to an option,
201 a positive value is returned if the option is supported,
202 and \-1 is returned if the option is not supported.
205 the current value of the option or limit is returned.
206 This value will not be more restrictive than
207 the corresponding value that was described to the application in
211 when the application was compiled.
216 Search permission is denied for one of the directories in the path prefix of
222 is not a valid file descriptor.
229 The implementation does not support an association of
231 with the specified file.
235 Too many symbolic links were encountered while resolving
253 A component used as a directory in
255 is not in fact a directory.
257 For an explanation of the terms used in this section, see
265 Interface Attribute Value
269 T} Thread safety MT-Safe
275 POSIX.1-2001, POSIX.1-2008.
277 Files with name lengths longer than the value returned for
281 may exist in the given directory.
283 Some returned values may be huge; they are not suitable for allocating