]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
bf5a7247 | 2 | .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) |
bc051678 | 3 | .\" and Copyright (C) 2017 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da | 4 | .\" |
5fbde956 | 5 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
c08df37a | 6 | .\" |
fea681da | 7 | .\" Modified Wed Jul 28 11:12:26 1993 by Rik Faith (faith@cs.unc.edu) |
e2bfd6df MK |
8 | .\" |
9 | .\" FIXME Probably all of the following should be documented: | |
10 | .\" _PC_SYNC_IO, | |
11 | .\" _PC_ASYNC_IO, | |
12 | .\" _PC_PRIO_IO, | |
13 | .\" _PC_SOCK_MAXBUF, | |
14 | .\" _PC_FILESIZEBITS, | |
15 | .\" _PC_REC_INCR_XFER_SIZE, | |
16 | .\" _PC_REC_MAX_XFER_SIZE, | |
17 | .\" _PC_REC_MIN_XFER_SIZE, | |
18 | .\" _PC_REC_XFER_ALIGN, | |
19 | .\" _PC_ALLOC_SIZE_MIN, | |
20 | .\" _PC_SYMLINK_MAX, | |
21 | .\" _PC_2_SYMLINKS | |
9f1b9726 | 22 | .\" |
4c1c5274 | 23 | .TH fpathconf 3 (date) "Linux man-pages (unreleased)" |
fea681da MK |
24 | .SH NAME |
25 | fpathconf, pathconf \- get configuration values for files | |
cfba38f4 AC |
26 | .SH LIBRARY |
27 | Standard C library | |
28 | .RI ( libc ", " \-lc ) | |
fea681da MK |
29 | .SH SYNOPSIS |
30 | .nf | |
31 | .B #include <unistd.h> | |
68e4db0a | 32 | .PP |
d3b03141 | 33 | .BI "long fpathconf(int " fd ", int " name ); |
86138c4d | 34 | .BI "long pathconf(const char *" path ", int " name ); |
fea681da MK |
35 | .fi |
36 | .SH DESCRIPTION | |
63aa9df0 | 37 | .BR fpathconf () |
fea681da MK |
38 | gets a value for the configuration option |
39 | .I name | |
40 | for the open file descriptor | |
d3b03141 | 41 | .IR fd . |
fea681da | 42 | .PP |
63aa9df0 | 43 | .BR pathconf () |
fea681da MK |
44 | gets a value for configuration option |
45 | .I name | |
2c5f1089 | 46 | for the filename |
fea681da MK |
47 | .IR path . |
48 | .PP | |
49 | The corresponding macros defined in | |
bd12ab88 | 50 | .I <unistd.h> |
fea681da MK |
51 | are minimum values; if an application wants to take advantage of values |
52 | which may change, a call to | |
63aa9df0 | 53 | .BR fpathconf () |
fea681da | 54 | or |
63aa9df0 | 55 | .BR pathconf () |
fea681da MK |
56 | can be made, which may yield more liberal results. |
57 | .PP | |
58 | Setting | |
59 | .I name | |
60 | equal to one of the following constants returns the following | |
61 | configuration options: | |
62 | .TP | |
63 | .B _PC_LINK_MAX | |
5425e5c5 | 64 | The maximum number of links to the file. |
c13182ef | 65 | If |
d3b03141 | 66 | .I fd |
fea681da MK |
67 | or |
68 | .I path | |
69 | refer to a directory, then the value applies to the whole directory. | |
70 | The corresponding macro is | |
71 | .BR _POSIX_LINK_MAX . | |
72 | .TP | |
73 | .B _PC_MAX_CANON | |
5425e5c5 | 74 | The maximum length of a formatted input line, where |
d3b03141 | 75 | .I fd |
fea681da MK |
76 | or |
77 | .I path | |
78 | must refer to a terminal. | |
79 | The corresponding macro is | |
80 | .BR _POSIX_MAX_CANON . | |
81 | .TP | |
82 | .B _PC_MAX_INPUT | |
5425e5c5 | 83 | The maximum length of an input line, where |
d3b03141 | 84 | .I fd |
fea681da MK |
85 | or |
86 | .I path | |
87 | must refer to a terminal. | |
88 | The corresponding macro is | |
89 | .BR _POSIX_MAX_INPUT . | |
90 | .TP | |
91 | .B _PC_NAME_MAX | |
5425e5c5 | 92 | The maximum length of a filename in the directory |
fea681da MK |
93 | .I path |
94 | or | |
1ae6b2c7 | 95 | .I fd |
40725279 | 96 | that the process is allowed to create. |
fea681da MK |
97 | The corresponding macro is |
98 | .BR _POSIX_NAME_MAX . | |
99 | .TP | |
100 | .B _PC_PATH_MAX | |
5425e5c5 | 101 | The maximum length of a relative pathname when |
fea681da MK |
102 | .I path |
103 | or | |
d3b03141 | 104 | .I fd |
c13182ef MK |
105 | is the current working directory. |
106 | The corresponding macro is | |
fea681da MK |
107 | .BR _POSIX_PATH_MAX . |
108 | .TP | |
109 | .B _PC_PIPE_BUF | |
6cde4271 MK |
110 | The maximum number of bytes that can be written atomically to a pipe of FIFO. |
111 | For | |
112 | .BR fpathconf (), | |
d3b03141 | 113 | .I fd |
6cde4271 MK |
114 | should refer to a pipe or FIFO. |
115 | For | |
116 | .BR fpathconf (), | |
fea681da | 117 | .I path |
6cde4271 MK |
118 | should refer to a FIFO or a directory; in the latter case, |
119 | the returned value corresponds to FIFOs created in that directory. | |
1c44bd5b | 120 | The corresponding macro is |
fea681da MK |
121 | .BR _POSIX_PIPE_BUF . |
122 | .TP | |
123 | .B _PC_CHOWN_RESTRICTED | |
3509905b | 124 | This returns a positive value if the use of |
fea681da | 125 | .BR chown (2) |
3509905b MK |
126 | and |
127 | .BR fchown (2) | |
128 | for changing a file's user ID is restricted to a process | |
129 | with appropriate privileges, | |
130 | and changing a file's group ID to a value other than the process's | |
131 | effective group ID or one of its supplementary group IDs | |
132 | is restricted to a process with appropriate privileges. | |
133 | According to POSIX.1, | |
134 | this variable shall always be defined with a value other than \-1. | |
135 | The corresponding macro is | |
136 | .BR _POSIX_CHOWN_RESTRICTED . | |
137 | .IP | |
c13182ef | 138 | If |
d3b03141 | 139 | .I fd |
fea681da MK |
140 | or |
141 | .I path | |
3509905b MK |
142 | refers to a directory, |
143 | then the return value applies to all files in that directory. | |
fea681da MK |
144 | .TP |
145 | .B _PC_NO_TRUNC | |
5425e5c5 | 146 | This returns nonzero if accessing filenames longer than |
fea681da | 147 | .B _POSIX_NAME_MAX |
c13182ef MK |
148 | generates an error. |
149 | The corresponding macro is | |
fea681da MK |
150 | .BR _POSIX_NO_TRUNC . |
151 | .TP | |
152 | .B _PC_VDISABLE | |
5425e5c5 | 153 | This returns nonzero if special character processing can be disabled, where |
d3b03141 | 154 | .I fd |
fea681da MK |
155 | or |
156 | .I path | |
157 | must refer to a terminal. | |
47297adb | 158 | .SH RETURN VALUE |
081a3c71 | 159 | The return value of these functions is one of the following: |
cdede5cd | 160 | .IP \[bu] 3 |
081a3c71 | 161 | On error, \-1 is returned and |
fea681da | 162 | .I errno |
855d489a | 163 | is set to indicate the error |
081a3c71 MK |
164 | (for example, |
165 | .BR EINVAL , | |
166 | indicating that | |
167 | .I name | |
168 | is invalid). | |
cdede5cd | 169 | .IP \[bu] |
081a3c71 MK |
170 | If |
171 | .I name | |
172 | corresponds to a maximum or minimum limit, and that limit is indeterminate, | |
173 | \-1 is returned and | |
174 | .I errno | |
175 | is not changed. | |
176 | (To distinguish an indeterminate limit from an error, set | |
177 | .I errno | |
178 | to zero before the call, and then check whether | |
fea681da | 179 | .I errno |
081a3c71 | 180 | is nonzero when \-1 is returned.) |
cdede5cd | 181 | .IP \[bu] |
081a3c71 MK |
182 | If |
183 | .I name | |
184 | corresponds to an option, | |
185 | a positive value is returned if the option is supported, | |
186 | and \-1 is returned if the option is not supported. | |
cdede5cd | 187 | .IP \[bu] |
081a3c71 MK |
188 | Otherwise, |
189 | the current value of the option or limit is returned. | |
190 | This value will not be more restrictive than | |
191 | the corresponding value that was described to the application in | |
192 | .I <unistd.h> | |
193 | or | |
194 | .I <limits.h> | |
195 | when the application was compiled. | |
09c8f2e4 MK |
196 | .SH ERRORS |
197 | .TP | |
198 | .B EACCES | |
199 | .RB ( pathconf ()) | |
200 | Search permission is denied for one of the directories in the path prefix of | |
201 | .IR path . | |
202 | .TP | |
203 | .B EBADF | |
204 | .RB ( fpathconf ()) | |
205 | .I fd | |
206 | is not a valid file descriptor. | |
207 | .TP | |
208 | .B EINVAL | |
209 | .I name | |
210 | is invalid. | |
211 | .TP | |
212 | .B EINVAL | |
213 | The implementation does not support an association of | |
214 | .I name | |
215 | with the specified file. | |
216 | .TP | |
217 | .B ELOOP | |
218 | .RB ( pathconf ()) | |
219 | Too many symbolic links were encountered while resolving | |
220 | .IR path . | |
221 | .TP | |
222 | .B ENAMETOOLONG | |
223 | .RB ( pathconf ()) | |
224 | .I path | |
225 | is too long. | |
226 | .TP | |
227 | .B ENOENT | |
228 | .RB ( pathconf ()) | |
229 | A component of | |
230 | .I path | |
231 | does not exist, or | |
232 | .I path | |
233 | is an empty string. | |
234 | .TP | |
235 | .B ENOTDIR | |
236 | .RB ( pathconf ()) | |
237 | A component used as a directory in | |
238 | .I path | |
239 | is not in fact a directory. | |
90f1e9c5 MS |
240 | .SH ATTRIBUTES |
241 | For an explanation of the terms used in this section, see | |
242 | .BR attributes (7). | |
243 | .TS | |
244 | allbox; | |
c466875e | 245 | lbx lb lb |
90f1e9c5 MS |
246 | l l l. |
247 | Interface Attribute Value | |
248 | T{ | |
9e54434e BR |
249 | .na |
250 | .nh | |
90f1e9c5 MS |
251 | .BR fpathconf (), |
252 | .BR pathconf () | |
253 | T} Thread safety MT-Safe | |
254 | .TE | |
c466875e | 255 | .sp 1 |
3113c7f3 | 256 | .SH STANDARDS |
4131356c AC |
257 | POSIX.1-2008. |
258 | .SH HISTORY | |
259 | POSIX.1-2001. | |
fea681da MK |
260 | .SH NOTES |
261 | Files with name lengths longer than the value returned for | |
262 | .I name | |
263 | equal to | |
264 | .B _PC_NAME_MAX | |
265 | may exist in the given directory. | |
266 | .PP | |
267 | Some returned values may be huge; they are not suitable for allocating | |
268 | memory. | |
47297adb | 269 | .SH SEE ALSO |
fea681da MK |
270 | .BR getconf (1), |
271 | .BR open (2), | |
272 | .BR statfs (2), | |
eff9ff0d | 273 | .BR confstr (3), |
fea681da | 274 | .BR sysconf (3) |