]>
Commit | Line | Data |
---|---|---|
9905e59b DH |
1 | '\" t |
2 | .\" Copyright (c) 2017 David Howells <dhowells@redhat.com> | |
3 | .\" | |
4 | .\" Derived from the stat.2 manual page: | |
5 | .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 | |
6 | .\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95 | |
7 | .\" and Copyright (c) 2006, 2007, 2014 Michael Kerrisk <mtk.manpages@gmail.com> | |
8 | .\" | |
9 | .\" %%%LICENSE_START(VERBATIM) | |
10 | .\" Permission is granted to make and distribute verbatim copies of this | |
11 | .\" manual provided the copyright notice and this permission notice are | |
12 | .\" preserved on all copies. | |
13 | .\" | |
14 | .\" Permission is granted to copy and distribute modified versions of this | |
15 | .\" manual under the conditions for verbatim copying, provided that the | |
16 | .\" entire resulting derived work is distributed under the terms of a | |
17 | .\" permission notice identical to this one. | |
18 | .\" | |
19 | .\" Since the Linux kernel and libraries are constantly changing, this | |
20 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
21 | .\" responsibility for errors or omissions, or for damages resulting from | |
22 | .\" the use of the information contained herein. The author(s) may not | |
23 | .\" have taken the same level of care in the production of this manual, | |
24 | .\" which is licensed free of charge, as they might when working | |
25 | .\" professionally. | |
26 | .\" | |
27 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
28 | .\" the source, must acknowledge the copyright and authors of this work. | |
29 | .\" %%%LICENSE_END | |
30 | .\" | |
31 | .TH STATX 2 2017-03-07 "Linux" "Linux Programmer's Manual" | |
32 | .SH NAME | |
33 | statx \- Get file status (extended) | |
34 | .SH SYNOPSIS | |
35 | .nf | |
36 | .B #include <sys/types.h> | |
37 | .br | |
38 | .B #include <sys/stat.h> | |
39 | .br | |
40 | .B #include <unistd.h> | |
41 | .br | |
42 | .BR "#include <fcntl.h> " "/* Definition of AT_* constants */" | |
43 | .sp | |
44 | .BI "int statx(int " dirfd ", const char *" pathname ", int " flags "," | |
45 | .BI " unsigned int " mask ", struct statx *" buf ); | |
46 | .fi | |
47 | .sp | |
48 | .in -4n | |
49 | Feature Test Macro Requirements for glibc (see | |
50 | .BR feature_test_macros (7)): | |
51 | .in | |
52 | .ad l | |
53 | .PD 0 | |
54 | .sp | |
55 | .RS 4 | |
56 | <unknown as yet> | |
57 | .RE | |
58 | .PD | |
59 | .ad | |
60 | .SH DESCRIPTION | |
61 | .PP | |
62 | This function returns information about a file, storing it in the buffer | |
63 | pointed to by | |
64 | .IR buf . | |
65 | The buffer is filled in according to the following type: | |
66 | .PP | |
67 | .in +4n | |
68 | .nf | |
69 | struct statx { | |
70 | __u32 stx_mask; -- Mask of bits indicating filled fields | |
71 | __u32 stx_blksize; -- Block size for filesystem I/O | |
72 | __u64 stx_attributes; -- Extra file attribute indicators | |
73 | __u32 stx_nlink; -- Number of hard links | |
74 | __u32 stx_uid; -- User ID of owner | |
75 | __u32 stx_gid; -- Group ID of owner | |
76 | __u16 stx_mode; -- File type and mode | |
77 | __u64 stx_ino; -- Inode number | |
78 | __u64 stx_size; -- Total size in bytes | |
79 | __u64 stx_blocks; -- Number of 512B blocks allocated | |
80 | struct statx_timestamp stx_atime; -- Time of last access | |
81 | struct statx_timestamp stx_btime; -- Time of creation | |
82 | struct statx_timestamp stx_ctime; -- Time of last status change | |
83 | struct statx_timestamp stx_mtime; -- Time of last modification | |
84 | __u32 stx_rdev_major; } Device number if device file | |
85 | __u32 stx_rdev_minor; } | |
86 | __u32 stx_dev_major; } Device number of containing file | |
87 | __u32 stx_dev_minor; } | |
88 | }; | |
89 | .fi | |
90 | .in | |
91 | .PP | |
92 | Where the timestamps are defined as: | |
93 | .PP | |
94 | .in +4n | |
95 | .nf | |
96 | struct statx_timestamp { | |
97 | __s64 tv_sec; -- Number of seconds (UNIX time) | |
98 | __s32 tv_nsec; -- Number of nanoseconds before or since tv_sec | |
99 | }; | |
100 | .fi | |
101 | .in | |
102 | .PP | |
103 | (Note that reserved space and padding is omitted) | |
104 | .SS | |
105 | Invoking \fBstatx\fR(): | |
106 | .PP | |
107 | To access a file's status, no permissions are required on the file itself, but | |
108 | in the case of | |
109 | .BR statx () | |
110 | with a path, execute (search) permission is required on all of the directories | |
111 | in | |
112 | .I pathname | |
113 | that lead to the file. | |
114 | .PP | |
115 | .BR statx () | |
116 | uses | |
117 | .IR pathname ", " dirfd " and " flags | |
118 | to locate the target file in one of a variety of ways: | |
119 | .TP | |
120 | [*] By absolute path. | |
121 | .I pathname | |
122 | points to an absolute path and | |
123 | .I dirfd | |
124 | is ignored. The file is looked up by name, starting from the root of the | |
125 | filesystem as seen by the calling process. | |
126 | .TP | |
127 | [*] By cwd-relative path. | |
128 | .I pathname | |
129 | points to a relative path and | |
130 | .IR dirfd " is " AT_FDCWD . | |
131 | The file is looked up by name, starting from the current working directory. | |
132 | .TP | |
133 | [*] By dir-relative path. | |
134 | .I pathname | |
135 | points to relative path and | |
136 | .I dirfd | |
137 | indicates a file descriptor pointing to a directory. The file is looked up by | |
138 | name, starting from the directory specified by | |
139 | .IR dirfd . | |
140 | .TP | |
141 | [*] By file descriptor. | |
142 | .IR pathname " is " NULL " and " dirfd | |
143 | indicates a file descriptor. The file attached to the file descriptor is | |
144 | queried directly. The file descriptor may point to any type of file, not just | |
145 | a directory. | |
146 | .PP | |
147 | .I flags | |
148 | can be used to influence a path-based lookup. A value for | |
149 | .I flags | |
150 | is constructed by OR'ing together zero or more of the following constants: | |
151 | .TP | |
152 | .BR AT_EMPTY_PATH | |
153 | .\" commit 65cfc6722361570bfe255698d9cd4dccaf47570d | |
154 | If | |
155 | .I pathname | |
156 | is an empty string, operate on the file referred to by | |
157 | .IR dirfd | |
158 | (which may have been obtained using the | |
159 | .BR open (2) | |
160 | .B O_PATH | |
161 | flag). | |
162 | If | |
163 | .I dirfd | |
164 | is | |
165 | .BR AT_FDCWD , | |
166 | the call operates on the current working directory. | |
167 | In this case, | |
168 | .I dirfd | |
169 | can refer to any type of file, not just a directory. | |
170 | This flag is Linux-specific; define | |
171 | .B _GNU_SOURCE | |
172 | .\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed | |
173 | to obtain its definition. | |
174 | .TP | |
175 | .BR AT_NO_AUTOMOUNT | |
176 | Don't automount the terminal ("basename") component of | |
177 | .I pathname | |
178 | if it is a directory that is an automount point. | |
179 | This allows the caller to gather attributes of an automount point | |
180 | (rather than the location it would mount). | |
181 | This flag can be used in tools that scan directories | |
182 | to prevent mass-automounting of a directory of automount points. | |
183 | The | |
184 | .B AT_NO_AUTOMOUNT | |
185 | flag has no effect if the mount point has already been mounted over. | |
186 | This flag is Linux-specific; define | |
187 | .B _GNU_SOURCE | |
188 | .\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed | |
189 | to obtain its definition. | |
190 | .TP | |
191 | .B AT_SYMLINK_NOFOLLOW | |
192 | If | |
193 | .I pathname | |
194 | is a symbolic link, do not dereference it: | |
195 | instead return information about the link itself, like | |
196 | .BR lstat (). | |
197 | .PP | |
198 | .I flags | |
199 | can also be used to control what sort of synchronisation the kernel will do | |
200 | when querying a file on a remote filesystem. This is done by OR'ing in one of | |
201 | the following values: | |
202 | .TP | |
203 | AT_STATX_SYNC_AS_STAT | |
204 | Do whatever | |
205 | .BR stat () | |
206 | does. This is the default and is very much filesystem specific. | |
207 | .TP | |
208 | AT_STATX_FORCE_SYNC | |
209 | Force the attributes to be synchronised with the server. This may require that | |
210 | a network filesystem perform a data writeback to get the timestamps correct. | |
211 | .TP | |
212 | AT_STATX_DONT_SYNC | |
213 | Don't synchronise anything, but rather just take whatever the system has cached | |
214 | if possible. This may mean that the information returned is approximate, but, | |
215 | on a network filesystem, it may not involve a round trip to the server - even | |
216 | if no lease is held. | |
217 | .PP | |
218 | The | |
219 | .I mask | |
220 | argument to | |
221 | .BR statx () | |
222 | is used to tell the kernel which fields the caller is interested in. | |
223 | .I mask | |
224 | is an OR'ed combination of the following constants: | |
225 | .PP | |
226 | .in +4n | |
227 | .TS | |
228 | lB l. | |
229 | STATX_TYPE Want stx_mode & S_IFMT | |
230 | STATX_MODE Want stx_mode & ~S_IFMT | |
231 | STATX_NLINK Want stx_nlink | |
232 | STATX_UID Want stx_uid | |
233 | STATX_GID Want stx_gid | |
234 | STATX_ATIME Want stx_atime{,_ns} | |
235 | STATX_MTIME Want stx_mtime{,_ns} | |
236 | STATX_CTIME Want stx_ctime{,_ns} | |
237 | STATX_INO Want stx_ino | |
238 | STATX_SIZE Want stx_size | |
239 | STATX_BLOCKS Want stx_blocks | |
240 | STATX_BASIC_STATS [All of the above] | |
241 | STATX_BTIME Want stx_btime{,_ns} | |
242 | STATX_ALL [All currently available fields] | |
243 | .TE | |
244 | .in | |
245 | .PP | |
246 | .B "Do not" | |
247 | simply set | |
248 | .I mask | |
249 | to UINT_MAX as one or more bits may, in the future, be used to specify an | |
250 | extension to the buffer. | |
251 | .SS | |
252 | The returned information | |
253 | .PP | |
254 | The status information for the target file is returned in the | |
255 | .I statx | |
256 | structure pointed to by | |
257 | .IR buf . | |
258 | Included in this is | |
259 | .I stx_mask | |
260 | which indicates what other information has been returned. | |
261 | .I stx_mask | |
262 | has the same format as the mask argument and bits are set in it to indicate | |
263 | which fields have been filled in. | |
264 | .PP | |
265 | It should be noted that the kernel may return fields that weren't requested and | |
266 | may fail to return fields that were requested, depending on what the backing | |
267 | filesystem supports. In either case, | |
268 | .I stx_mask | |
269 | will not be equal | |
270 | .IR mask . | |
271 | .PP | |
272 | If a filesystem does not support a field or if it has an unrepresentable value | |
273 | (for instance, a file with an exotic type), then the mask bit corresponding to | |
274 | that field will be cleared in | |
275 | .I stx_mask | |
276 | even if the user asked for it and a dummy value will be filled in for | |
277 | compatibility purposes if one is available (e.g. a dummy uid and gid may be | |
278 | specified to mount under some circumstances). | |
279 | .PP | |
280 | A filesystem may also fill in fields that the caller didn't ask for if it has | |
281 | values for them available at no extra cost. If this happens, the corresponding | |
282 | bits will be set in | |
283 | .IR stx_mask . | |
284 | .PP | |
285 | ||
286 | .\" Background: inode attributes are modified with i_mutex held, but | |
287 | .\" read by stat() without taking the mutex. | |
288 | .I Note: | |
289 | For performance and simplicity reasons, different fields in the | |
290 | .I statx | |
291 | structure may contain state information from different moments | |
292 | during the execution of the system call. | |
293 | For example, if | |
294 | .IR stx_mode | |
295 | or | |
296 | .IR stx_uid | |
297 | is changed by another process by calling | |
298 | .BR chmod (2) | |
299 | or | |
300 | .BR chown (2), | |
301 | .BR stat () | |
302 | might return the old | |
303 | .I stx_mode | |
304 | together with the new | |
305 | .IR stx_uid , | |
306 | or the old | |
307 | .I stx_uid | |
308 | together with the new | |
309 | .IR stx_mode . | |
310 | .PP | |
311 | Apart from stx_mask (which is described above), the fields in the | |
312 | .I statx | |
313 | structure are: | |
314 | .TP | |
315 | .I stx_mode | |
316 | The file type and mode. This is described in more detail below. | |
317 | .TP | |
318 | .I stx_size | |
319 | The size of the file (if it is a regular file or a symbolic link) in bytes. | |
320 | The size of a symbolic link is the length of the pathname it contains, without | |
321 | a terminating null byte. | |
322 | .TP | |
323 | .I stx_blocks | |
324 | The number of blocks allocated to the file on the medium, in 512-byte units. | |
325 | (This may be smaller than | |
326 | .IR stx_size /512 | |
327 | when the file has holes.) | |
328 | .TP | |
329 | .I stx_blksize | |
330 | The "preferred" blocksize for efficient filesystem I/O. (Writing to a file in | |
331 | smaller chunks may cause an inefficient read-modify-rewrite.) | |
332 | .TP | |
333 | .I stx_nlink | |
334 | The number of hard links on a file. | |
335 | .TP | |
336 | .I stx_uid | |
337 | The user ID of the file's owner. | |
338 | .TP | |
339 | .I stx_gid | |
340 | The ID of the group that may access the file. | |
341 | .TP | |
342 | .IR stx_dev_major " and " stx_dev_minor | |
343 | The device on which this file (inode) resides. | |
344 | .TP | |
345 | .IR stx_rdev_major " and " stx_rdev_minor | |
346 | The device that this file (inode) represents if the file is of block or | |
347 | character device type. | |
348 | .TP | |
349 | .I stx_attributes | |
350 | Further status information about the file (see below for more information). | |
351 | .TP | |
352 | .I stx_atime | |
353 | The file's last access timestamp. | |
354 | This field is changed by file accesses, for example, by | |
355 | .BR execve (2), | |
356 | .BR mknod (2), | |
357 | .BR pipe (2), | |
358 | .BR utime (2), | |
359 | and | |
360 | .BR read (2) | |
361 | (of more than zero bytes). | |
362 | Other routines, such as | |
363 | .BR mmap (2), | |
364 | may or may not update it. | |
365 | .TP | |
366 | .I stx_btime | |
367 | The file's creation timestamp. This is set on file creation and not changed | |
368 | subsequently. | |
369 | .TP | |
370 | .I stx_ctime | |
371 | The file's last status change timestamp. This field is changed by writing or | |
372 | by setting inode information (i.e., owner, group, link count, mode, etc.). | |
373 | .TP | |
374 | .I stx_mtime | |
375 | The file's last modification timestamp. This is changed by file modifications, | |
376 | for example, by | |
377 | .BR mknod (2), | |
378 | .BR truncate (2), | |
379 | .BR utime (2), | |
380 | and | |
381 | .BR write (2) | |
382 | (of more than zero bytes). Moreover, the modification time of a directory is | |
383 | changed by the creation or deletion of files in that directory. This field is | |
384 | .I not | |
385 | changed for changes in owner, group, hard link count, or mode. | |
386 | ||
387 | ||
388 | ||
389 | .PP | |
390 | Not all of the Linux filesystems implement all of the timestamp fields. Some | |
391 | filesystems allow mounting in such a way that file and/or directory accesses do | |
392 | not cause an update of the | |
393 | .I stx_atime | |
394 | field. | |
395 | (See | |
396 | .IR noatime , | |
397 | .IR nodiratime , | |
398 | and | |
399 | .I relatime | |
400 | in | |
401 | .BR mount (8), | |
402 | and related information in | |
403 | .BR mount (2).) | |
404 | In addition, | |
405 | .I stx_atime | |
406 | is not updated if a file is opened with the | |
407 | .BR O_NOATIME ; | |
408 | see | |
409 | .BR open (2). | |
410 | ||
411 | .SS File attributes | |
412 | .PP | |
413 | The | |
414 | .I stx_attributes | |
415 | field contains a set of OR'ed flags that indicate additional attributes of the | |
416 | file: | |
417 | .TP | |
418 | STATX_ATTR_COMPRESSED | |
419 | The file is compressed by the fs and may take extra resources to access. | |
420 | .TP | |
421 | STATX_ATTR_IMMUTABLE | |
422 | The file cannot be modified: it cannot be deleted or renamed, no hard links can | |
423 | be created to this file and no data can be written to it. See chattr(1). | |
424 | .TP | |
425 | STATX_ATTR_APPEND | |
426 | The file can only be opened in append mode for writing. Random access writing | |
427 | is not permitted. See chattr(1). | |
428 | .TP | |
429 | STATX_ATTR_NODUMP | |
430 | File is not a candidate for backup when a backup program such as dump(8) is | |
431 | run. See chattr(1). | |
432 | .TP | |
433 | STATX_ATTR_ENCRYPTED | |
434 | A key is required for the file to be encrypted by the filesystem. | |
435 | .SS File type and mode | |
436 | .PP | |
437 | The | |
438 | .I stx_mode | |
439 | field contains the combined file type and mode. POSIX refers to the bits in | |
440 | this field corresponding to the mask | |
441 | .B S_IFMT | |
442 | (see below) as the | |
443 | .IR "file type" , | |
444 | the 12 bits corresponding to the mask 07777 as the | |
445 | .IR "file mode bits" | |
446 | and the least significant 9 bits (0777) as the | |
447 | .IR "file permission bits" . | |
448 | .IP | |
449 | The following mask values are defined for the file type of the | |
450 | .I stx_mode | |
451 | field: | |
452 | .in +4n | |
453 | .TS | |
454 | lB l l. | |
455 | S_IFMT 0170000 bit mask for the file type bit field | |
456 | ||
457 | S_IFSOCK 0140000 socket | |
458 | S_IFLNK 0120000 symbolic link | |
459 | S_IFREG 0100000 regular file | |
460 | S_IFBLK 0060000 block device | |
461 | S_IFDIR 0040000 directory | |
462 | S_IFCHR 0020000 character device | |
463 | S_IFIFO 0010000 FIFO | |
464 | .TE | |
465 | .in | |
466 | .IP | |
467 | Note that | |
468 | .I stx_mode | |
469 | has two mask flags covering it: one for the type and one for the mode bits. | |
470 | .PP | |
471 | To test for a regular file (for example), one could write: | |
472 | .nf | |
473 | .in +4n | |
474 | statx(AT_FDCWD, pathname, 0, STATX_TYPE, &sb); | |
475 | if ((sb.stx_mask & STATX_TYPE) && (sb.stx_mode & S_IFMT) == S_IFREG) { | |
476 | /* Handle regular file */ | |
477 | } | |
478 | .in | |
479 | .fi | |
480 | .PP | |
481 | Because tests of the above form are common, additional macros are defined by | |
482 | POSIX to allow the test of the file type in | |
483 | .I stx_mode | |
484 | to be written more concisely: | |
485 | .RS 4 | |
486 | .TS | |
487 | lB l. | |
488 | \fBS_ISREG\fR(m) Is it a regular file? | |
489 | \fBS_ISDIR\fR(m) Is it a directory? | |
490 | \fBS_ISCHR\fR(m) Is it a character device? | |
491 | \fBS_ISBLK\fR(m) Is it a block device? | |
492 | \fBS_ISFIFO\fR(m) Is it a FIFO (named pipe)? | |
493 | \fBS_ISLNK\fR(m) Is it a symbolic link? (Not in POSIX.1-1996.) | |
494 | \fBS_ISSOCK\fR(m) Is it a socket? (Not in POSIX.1-1996.) | |
495 | .TE | |
496 | .RE | |
497 | .PP | |
498 | The preceding code snippet could thus be rewritten as: | |
499 | ||
500 | .nf | |
501 | .in +4n | |
502 | statx(AT_FDCWD, pathname, 0, STATX_TYPE, &sb); | |
503 | if ((sb.stx_mask & STATX_TYPE) && S_ISREG(sb.stx_mode)) { | |
504 | /* Handle regular file */ | |
505 | } | |
506 | .in | |
507 | .fi | |
508 | .PP | |
509 | The definitions of most of the above file type test macros | |
510 | are provided if any of the following feature test macros is defined: | |
511 | .BR _BSD_SOURCE | |
512 | (in glibc 2.19 and earlier), | |
513 | .BR _SVID_SOURCE | |
514 | (in glibc 2.19 and earlier), | |
515 | or | |
516 | .BR _DEFAULT_SOURCE | |
517 | (in glibc 2.20 and later). | |
518 | In addition, definitions of all of the above macros except | |
519 | .BR S_IFSOCK | |
520 | and | |
521 | .BR S_ISSOCK () | |
522 | are provided if | |
523 | .BR _XOPEN_SOURCE | |
524 | is defined. | |
525 | The definition of | |
526 | .BR S_IFSOCK | |
527 | can also be exposed by defining | |
528 | .BR _XOPEN_SOURCE | |
529 | with a value of 500 or greater. | |
530 | ||
531 | The definition of | |
532 | .BR S_ISSOCK () | |
533 | is exposed if any of the following feature test macros is defined: | |
534 | .BR _BSD_SOURCE | |
535 | (in glibc 2.19 and earlier), | |
536 | .BR _DEFAULT_SOURCE | |
537 | (in glibc 2.20 and later), | |
538 | .BR _XOPEN_SOURCE | |
539 | with a value of 500 or greater, or | |
540 | .BR _POSIX_C_SOURCE | |
541 | with a value of 200112L or greater. | |
542 | .PP | |
543 | The following mask values are defined for | |
544 | the file mode component of the | |
545 | .I stx_mode | |
546 | field: | |
547 | .in +4n | |
548 | .TS | |
549 | lB l l. | |
550 | S_ISUID 04000 set-user-ID bit | |
551 | S_ISGID 02000 set-group-ID bit (see below) | |
552 | S_ISVTX 01000 sticky bit (see below) | |
553 | ||
554 | S_IRWXU 00700 owner has read, write, and execute permission | |
555 | S_IRUSR 00400 owner has read permission | |
556 | S_IWUSR 00200 owner has write permission | |
557 | S_IXUSR 00100 owner has execute permission | |
558 | ||
559 | S_IRWXG 00070 group has read, write, and execute permission | |
560 | S_IRGRP 00040 group has read permission | |
561 | S_IWGRP 00020 group has write permission | |
562 | S_IXGRP 00010 group has execute permission | |
563 | ||
564 | S_IRWXO 00007 T{ | |
565 | others (not in group) have read, write, and execute permission | |
566 | T} | |
567 | S_IROTH 00004 others have read permission | |
568 | S_IWOTH 00002 others have write permission | |
569 | S_IXOTH 00001 others have execute permission | |
570 | .TE | |
571 | .in | |
572 | .P | |
573 | The set-group-ID bit | |
574 | .RB ( S_ISGID ) | |
575 | has several special uses. | |
576 | For a directory, it indicates that BSD semantics is to be used | |
577 | for that directory: files created there inherit their group ID from | |
578 | the directory, not from the effective group ID of the creating process, | |
579 | and directories created there will also get the | |
580 | .B S_ISGID | |
581 | bit set. | |
582 | For a file that does not have the group execution bit | |
583 | .RB ( S_IXGRP ) | |
584 | set, | |
585 | the set-group-ID bit indicates mandatory file/record locking. | |
586 | .P | |
587 | The sticky bit | |
588 | .RB ( S_ISVTX ) | |
589 | on a directory means that a file | |
590 | in that directory can be renamed or deleted only by the owner | |
591 | of the file, by the owner of the directory, and by a privileged | |
592 | process. | |
593 | ||
594 | ||
595 | .SH RETURN VALUE | |
596 | On success, zero is returned. | |
597 | On error, \-1 is returned, and | |
598 | .I errno | |
599 | is set appropriately. | |
600 | .SH ERRORS | |
601 | .TP | |
602 | .B EINVAL | |
603 | Invalid flag specified in | |
604 | .IR flags . | |
605 | .TP | |
606 | .B EACCES | |
607 | Search permission is denied for one of the directories | |
608 | in the path prefix of | |
609 | .IR pathname . | |
610 | (See also | |
611 | .BR path_resolution (7).) | |
612 | .TP | |
613 | .B EBADF | |
614 | .I dirfd | |
615 | is not a valid open file descriptor. | |
616 | .TP | |
617 | .B EFAULT | |
618 | Bad address. | |
619 | .TP | |
620 | .B ELOOP | |
621 | Too many symbolic links encountered while traversing the path. | |
622 | .TP | |
623 | .B ENAMETOOLONG | |
624 | .I pathname | |
625 | is too long. | |
626 | .TP | |
627 | .B ENOENT | |
628 | A component of | |
629 | .I pathname | |
630 | does not exist, or | |
631 | .I pathname | |
632 | is an empty string and AT_EMPTY_PATH was not specified. | |
633 | .TP | |
634 | .B ENOMEM | |
635 | Out of memory (i.e., kernel memory). | |
636 | .TP | |
637 | .B ENOTDIR | |
638 | A component of the path prefix of | |
639 | .I pathname | |
640 | is not a directory or | |
641 | .I pathname | |
642 | is relative and | |
643 | .I dirfd | |
644 | is a file descriptor referring to a file other than a directory. | |
645 | .SH VERSIONS | |
646 | .BR statx () | |
647 | was added to Linux in kernel 4.11; | |
648 | library support is not yet added to glibc. | |
649 | .SH SEE ALSO | |
650 | .BR ls (1), | |
651 | .BR stat (1), | |
652 | .BR access (2), | |
653 | .BR chmod (2), | |
654 | .BR chown (2), | |
655 | .BR stat (2), | |
656 | .BR readlink (2), | |
657 | .BR utime (2), | |
658 | .BR capabilities (7), | |
659 | .BR symlink (7) |