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