1fpathconf(2) System Calls fpathconf(2)
2
3
4
6 fpathconf, pathconf - get configurable pathname variables
7
9 #include <unistd.h>
10
11 long fpathconf(int fildes, int name);
12
13
14 long pathconf(const char *path, int name);
15
16
18 The fpathconf() and pathconf() functions determine the current value of
19 a configurable limit or option ( variable ) that is associated with a
20 file or directory.
21
22
23 For pathconf(), the path argument points to the pathname of a file or
24 directory.
25
26
27 For fpathconf(), the fildes argument is an open file descriptor.
28
29
30 The name argument represents the variable to be queried relative to
31 that file or directory. The variables in the following table come from
32 <limits.h> or <unistd.h> and the symbolic constants, defined in
33 <unistd.h>, are the corresponding values used for name:
34
35
36
37
38 ┌────────────────────────────┬──────────────────────────┬──────────────┐
39 │ Variable │ Value of name │ Notes │
40 ├────────────────────────────┼──────────────────────────┼──────────────┤
41 │{ACL_ENABLED} │ _PC_ACL_ENABLED │ 10 │
42 ├────────────────────────────┼──────────────────────────┼──────────────┤
43 │{FILESIZEBITS} │ _PC_FILESIZEBITS │ 3,4 │
44 ├────────────────────────────┼──────────────────────────┼──────────────┤
45 │{LINK_MAX} │ _PC_LINK_MAX │ 1 │
46 ├────────────────────────────┼──────────────────────────┼──────────────┤
47 │{MAX_CANON} │ _PC_MAX_CANON │ 2 │
48 ├────────────────────────────┼──────────────────────────┼──────────────┤
49 │{MAX_INPUT} │ _PC_MAX_INPUT │ 2 │
50 ├────────────────────────────┼──────────────────────────┼──────────────┤
51 │{MIN_HOLE_SIZE} │ _PC_MIN_HOLE_SIZE │ 11 │
52 ├────────────────────────────┼──────────────────────────┼──────────────┤
53 │{NAME_MAX} │ _PC_NAME_MAX │ 3, 4 │
54 ├────────────────────────────┼──────────────────────────┼──────────────┤
55 │{PATH_MAX} │ _PC_PATH_MAX │ 4,5 │
56 ├────────────────────────────┼──────────────────────────┼──────────────┤
57 │{PIPE_BUF} │ _PC_PIPE_BUF │ 6 │
58 ├────────────────────────────┼──────────────────────────┼──────────────┤
59 │{POSIX_ALLOC_SIZE_MIN} │ _PC_ALLOC_SIZE_MIN │ │
60 ├────────────────────────────┼──────────────────────────┼──────────────┤
61 │{POSIX_REC_INCR_XFER_SIZE} │ _PC_REC_INCR_XFER_SIZE │ │
62 ├────────────────────────────┼──────────────────────────┼──────────────┤
63 │{POSIX_REC_MAX_XFER_SIZE} │ _PC_REC_MAX_XFER_SIZE │ │
64 ├────────────────────────────┼──────────────────────────┼──────────────┤
65 │{POSIX_REC_MIN_XFER_SIZE} │ _PC_REC_MIN_XFER_SIZE │ │
66 ├────────────────────────────┼──────────────────────────┼──────────────┤
67 │{POSIX_REC_XFER_ALIGN} │ _PC_REC_XFER_ALIGN │ │
68 ├────────────────────────────┼──────────────────────────┼──────────────┤
69 │{SYMLINK_MAX} │ _PC_SYMLINK_MAX │ 4, 9 │
70 ├────────────────────────────┼──────────────────────────┼──────────────┤
71 │{XATTR_ENABLED} │ _PC_XATTR_ENABLED │ 1 │
72 ├────────────────────────────┼──────────────────────────┼──────────────┤
73 │{SATTR_ENABLED} │ _PC_SATTR_ENABLED │ │
74 ├────────────────────────────┼──────────────────────────┼──────────────┤
75 │{XATTR_EXISTS} │ _PC_XATTR_EXISTS │ 1 │
76 ├────────────────────────────┼──────────────────────────┼──────────────┤
77 │{SATTR_EXISTS} │ _PC_SATTR_EXISTS │ │
78 ├────────────────────────────┼──────────────────────────┼──────────────┤
79 │{ACCESS_FILTERING} │ _PC_ACCESS_FILTERING │ 12 │
80 ├────────────────────────────┼──────────────────────────┼──────────────┤
81 │_POSIX_CHOWN_RESTRICTED │ _PC_CHOWN_RESTRICTED │ 7 │
82 ├────────────────────────────┼──────────────────────────┼──────────────┤
83 │_POSIX_NO_TRUNC │ _PC_NO_TRUNC │ 3, 4 │
84 ├────────────────────────────┼──────────────────────────┼──────────────┤
85 │_POSIX_VDISABLE │ _PC_VDISABLE │ 2 │
86 ├────────────────────────────┼──────────────────────────┼──────────────┤
87 │_POSIX_ASYNC_IO │ _PC_ASYNC_IO │ 8 │
88 ├────────────────────────────┼──────────────────────────┼──────────────┤
89 │_POSIX_PRIO_IO │ _PC_PRIO_IO │ 8 │
90 ├────────────────────────────┼──────────────────────────┼──────────────┤
91 │_POSIX_SYNC_IO │ _PC_SYNC_IO │ 8 │
92 ├────────────────────────────┼──────────────────────────┼──────────────┤
93 │_POSIX_TIMESTAMP_RESOLUTION │ _PC_TIMESTAMP_RESOLUTION │ 1 │
94 └────────────────────────────┴──────────────────────────┴──────────────┘
95
96
97 Notes:
98
99 1. If path or fildes refers to a directory, the value returned
100 applies to the directory itself.
101
102 2. If path or fildes does not refer to a terminal file, it is
103 unspecified whether an implementation supports an associa‐
104 tion of the variable name with the specified file.
105
106 3. If path or fildes refers to a directory, the value returned
107 applies to filenames within the directory.
108
109 4. If path or fildes does not refer to a directory, it is
110 unspecified whether an implementation supports an associa‐
111 tion of the variable name with the specified file.
112
113 5. If path or fildes refers to a directory, the value returned
114 is the maximum length of a relative pathname when the speci‐
115 fied directory is the working directory.
116
117 6. If path refers to a FIFO, or fildes refers to a pipe or
118 FIFO, the value returned applies to the referenced object.
119 If path or fildes refers to a directory, the value returned
120 applies to any FIFO that exists or can be created within the
121 directory. If path or fildes refers to any other type of
122 file, it is unspecified whether an implementation supports
123 an association of the variable name with the specified file.
124
125 7. If path or fildes refers to a directory, the value returned
126 applies to any files, other than directories, that exist or
127 can be created within the directory.
128
129 8. If path or fildes refers to a directory, it is unspecified
130 whether an implementation supports an association of the
131 variable name with the specified file.
132
133 9. If path or fildes refers to a directory, the value returned
134 is the maximum length of the string that a symbolic link in
135 that directory can contain.
136
137 10. If path or fildes refers to a file or directory in a file
138 system that supports ACLs, the value returned is the bitwise
139 inclusive OR of the following flags associated with ACL
140 types supported by the file system; otherwise 0 is returned.
141
142 _ACL_ACE_ENABLEDThe file system supports ACE ACLs.
143
144
145 _ACL_ACLENT_ENABLED The file system supports UFS aclent ACLs.
146
147
148 11. If a filesystem supports the reporting of holes (see
149 lseek(2), pathconf() and fpathconf() return a positive num‐
150 ber that represents the minimum hole size returned in bytes.
151 The offsets of holes returned will be aligned to this same
152 value. A special value of 1 is returned if the filesystem
153 does not specify the minimum hole size but still reports
154 holes.
155
156 12. If path or fildes refers to a directory and the file system
157 in which the directory resides supports access filtering, a
158 non-zero value is returned. Otherwise, 0 is returned.
159
161 If name is an invalid value, both pathconf() and fpathconf() return −1
162 and errno is set to indicate the error.
163
164
165 If the variable corresponding to name has no limit for the path or file
166 descriptor, both pathconf() and fpathconf() return −1 without changing
167 errno. If pathconf() needs to use path to determine the value of name
168 and pathconf() does not support the association of name with the file
169 specified by path, or if the process did not have appropriate privi‐
170 leges to query the file specified by path, or path does not exist,
171 pathconf() returns −1 and errno is set to indicate the error.
172
173
174 If fpathconf() needs to use fildes to determine the value of name and
175 fpathconf() does not support the association of name with the file
176 specified by fildes, or if fildes is an invalid file descriptor, fpath‐
177 conf() returns −1 and errno is set to indicate the error.
178
179
180 Otherwise pathconf() or fpathconf() returns the current variable value
181 for the file or directory without changing errno. The value returned
182 will not be more restrictive than the corresponding value available to
183 the application when it was compiled with <limits.h> or <unistd.h>.
184
186 The pathconf() function will fail if:
187
188 EINVAL The value of name is not valid.
189
190
191 ELOOP A loop exists in symbolic links encountered during resolution
192 of the path argument.
193
194
195
196 The fpathconf() function will fail if:
197
198 EINVAL The value of name is not valid.
199
200
201
202 The pathconf() function may fail if:
203
204 EACCES Search permission is denied for a component of the path
205 prefix.
206
207
208 EINVAL An association of the variable name with the specified
209 file is not supported.
210
211
212 ENAMETOOLONG The length of the path argument exceeds {PATH_MAX} or a
213 pathname component is longer than {NAME_MAX}.
214
215
216 ENAMETOOLONG As a result of encountering a symbolic link in resolu‐
217 tion of the path argument, the length of the substi‐
218 tuted pathname string exceeded {PATH_MAX}.
219
220
221 ENOENT A component of path does not name an existing file or
222 path is an empty string.
223
224
225 ENOTDIR A component of the path prefix is not a directory.
226
227
228
229 The fpathconf() function may fail if:
230
231 EBADF The fildes argument is not a valid file descriptor.
232
233
234 EINVAL An association of the variable name with the specified file
235 is not supported.
236
237
239 The {SYMLINK_MAX} variable applies only to the fpathconf() function.
240
242 See attributes(5) for descriptions of the following attributes:
243
244
245
246
247 ┌─────────────────────────────┬─────────────────────────────┐
248 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
249 ├─────────────────────────────┼─────────────────────────────┤
250 │Interface Stability │Committed │
251 ├─────────────────────────────┼─────────────────────────────┤
252 │MT-Level │Async-Signal-Safe │
253 ├─────────────────────────────┼─────────────────────────────┤
254 │Standard │See standards(5). │
255 └─────────────────────────────┴─────────────────────────────┘
256
258 lseek(2), confstr(3C), limits.h(3HEAD), sysconf(3C), attributes(5),
259 standards(5)
260
261
262
263SunOS 5.11 1 Sep 2009 fpathconf(2)