]>
Commit | Line | Data |
---|---|---|
9905e59b DH |
1 | .\" Copyright (c) 2017 David Howells <dhowells@redhat.com> |
2 | .\" | |
3 | .\" Derived from the stat.2 manual page: | |
4 | .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 | |
5 | .\" Parts Copyright (c) 1995 Nicolai Langfeldt (janl@ifi.uio.no), 1/1/95 | |
6 | .\" and Copyright (c) 2006, 2007, 2014 Michael Kerrisk <mtk.manpages@gmail.com> | |
7 | .\" | |
8 | .\" %%%LICENSE_START(VERBATIM) | |
9 | .\" Permission is granted to make and distribute verbatim copies of this | |
10 | .\" manual provided the copyright notice and this permission notice are | |
11 | .\" preserved on all copies. | |
12 | .\" | |
13 | .\" Permission is granted to copy and distribute modified versions of this | |
14 | .\" manual under the conditions for verbatim copying, provided that the | |
15 | .\" entire resulting derived work is distributed under the terms of a | |
16 | .\" permission notice identical to this one. | |
17 | .\" | |
18 | .\" Since the Linux kernel and libraries are constantly changing, this | |
19 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
20 | .\" responsibility for errors or omissions, or for damages resulting from | |
21 | .\" the use of the information contained herein. The author(s) may not | |
22 | .\" have taken the same level of care in the production of this manual, | |
23 | .\" which is licensed free of charge, as they might when working | |
24 | .\" professionally. | |
25 | .\" | |
26 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
27 | .\" the source, must acknowledge the copyright and authors of this work. | |
28 | .\" %%%LICENSE_END | |
29 | .\" | |
6e00b7a8 | 30 | .TH STATX 2 2021-08-27 "Linux" "Linux Programmer's Manual" |
9905e59b | 31 | .SH NAME |
835f4293 | 32 | statx \- get file status (extended) |
9905e59b DH |
33 | .SH SYNOPSIS |
34 | .nf | |
c9f3f849 | 35 | .BR "#include <fcntl.h> " "/* Definition of " AT_* " constants */" |
9905e59b | 36 | .B #include <sys/stat.h> |
dbfe9c70 | 37 | .PP |
049d7f92 AC |
38 | .BI "int statx(int " dirfd ", const char *restrict " pathname ", int " flags , |
39 | .BI " unsigned int " mask ", struct statx *restrict " statxbuf ); | |
9905e59b | 40 | .fi |
9905e59b | 41 | .SH DESCRIPTION |
9905e59b DH |
42 | This function returns information about a file, storing it in the buffer |
43 | pointed to by | |
15d1f5ac | 44 | .IR statxbuf . |
c8701baf | 45 | The returned buffer is a structure of the following type: |
9905e59b DH |
46 | .PP |
47 | .in +4n | |
b8302363 | 48 | .EX |
9905e59b | 49 | struct statx { |
77a09ad7 MK |
50 | __u32 stx_mask; /* Mask of bits indicating |
51 | filled fields */ | |
52 | __u32 stx_blksize; /* Block size for filesystem I/O */ | |
53 | __u64 stx_attributes; /* Extra file attribute indicators */ | |
54 | __u32 stx_nlink; /* Number of hard links */ | |
55 | __u32 stx_uid; /* User ID of owner */ | |
56 | __u32 stx_gid; /* Group ID of owner */ | |
57 | __u16 stx_mode; /* File type and mode */ | |
58 | __u64 stx_ino; /* Inode number */ | |
59 | __u64 stx_size; /* Total size in bytes */ | |
60 | __u64 stx_blocks; /* Number of 512B blocks allocated */ | |
aabbefb4 | 61 | __u64 stx_attributes_mask; |
861d36ba | 62 | /* Mask to show what\(aqs supported |
aabbefb4 | 63 | in stx_attributes */ |
6a4667aa MK |
64 | |
65 | /* The following fields are file timestamps */ | |
66 | struct statx_timestamp stx_atime; /* Last access */ | |
67 | struct statx_timestamp stx_btime; /* Creation */ | |
68 | struct statx_timestamp stx_ctime; /* Last status change */ | |
69 | struct statx_timestamp stx_mtime; /* Last modification */ | |
70 | ||
20c8cd9a MK |
71 | /* If this file represents a device, then the next two |
72 | fields contain the ID of the device */ | |
77a09ad7 MK |
73 | __u32 stx_rdev_major; /* Major ID */ |
74 | __u32 stx_rdev_minor; /* Minor ID */ | |
6a4667aa MK |
75 | |
76 | /* The next two fields contain the ID of the device | |
790314d7 | 77 | containing the filesystem where the file resides */ |
77a09ad7 MK |
78 | __u32 stx_dev_major; /* Major ID */ |
79 | __u32 stx_dev_minor; /* Minor ID */ | |
728009a4 | 80 | __u64 stx_mnt_id; /* Mount ID */ |
9905e59b | 81 | }; |
b8302363 | 82 | .EE |
9905e59b DH |
83 | .in |
84 | .PP | |
6a4667aa | 85 | The file timestamps are structures of the following type: |
9905e59b DH |
86 | .PP |
87 | .in +4n | |
b8302363 | 88 | .EX |
9905e59b | 89 | struct statx_timestamp { |
6a4667aa | 90 | __s64 tv_sec; /* Seconds since the Epoch (UNIX time) */ |
aabbefb4 | 91 | __u32 tv_nsec; /* Nanoseconds since tv_sec */ |
9905e59b | 92 | }; |
b8302363 | 93 | .EE |
9905e59b DH |
94 | .in |
95 | .PP | |
790314d7 | 96 | (Note that reserved space and padding is omitted.) |
9905e59b DH |
97 | .SS |
98 | Invoking \fBstatx\fR(): | |
14b5d02a MK |
99 | To access a file's status, no permissions are required on the file itself, |
100 | but in the case of | |
9905e59b | 101 | .BR statx () |
835f4293 | 102 | with a pathname, |
14b5d02a | 103 | execute (search) permission is required on all of the directories in |
9905e59b DH |
104 | .I pathname |
105 | that lead to the file. | |
106 | .PP | |
107 | .BR statx () | |
108 | uses | |
6a4667aa MK |
109 | .IR pathname , |
110 | .IR dirfd , | |
111 | and | |
112 | .IR flags | |
56a05af6 | 113 | to identify the target file in one of the following ways: |
9905e59b | 114 | .TP |
7e43caf4 MK |
115 | An absolute pathname |
116 | If | |
9905e59b | 117 | .I pathname |
7e43caf4 MK |
118 | begins with a slash, |
119 | then it is an absolute pathname that identifies the target file. | |
120 | In this case, | |
9905e59b | 121 | .I dirfd |
14b5d02a | 122 | is ignored. |
9905e59b | 123 | .TP |
7e43caf4 MK |
124 | A relative pathname |
125 | If | |
9905e59b | 126 | .I pathname |
7e43caf4 | 127 | is a string that begins with a character other than a slash and |
6a4667aa MK |
128 | .IR dirfd |
129 | is | |
7e43caf4 MK |
130 | .BR AT_FDCWD , |
131 | then | |
132 | .I pathname | |
133 | is a relative pathname that is interpreted relative to the process's | |
134 | current working directory. | |
9905e59b | 135 | .TP |
aabbefb4 | 136 | A directory-relative pathname |
7e43caf4 | 137 | If |
9905e59b | 138 | .I pathname |
7e43caf4 | 139 | is a string that begins with a character other than a slash and |
9905e59b | 140 | .I dirfd |
7e43caf4 MK |
141 | is a file descriptor that refers to a directory, then |
142 | .I pathname | |
143 | is a relative pathname that is interpreted relative to the directory | |
144 | referred to by | |
9905e59b | 145 | .IR dirfd . |
717c3a7d MK |
146 | (See |
147 | .BR openat (2) | |
148 | for an explanation of why this is useful.) | |
9905e59b | 149 | .TP |
7e43caf4 MK |
150 | By file descriptor |
151 | If | |
77a09ad7 | 152 | .IR pathname |
85dbf7cd | 153 | is an empty string and the |
7e43caf4 | 154 | .B AT_EMPTY_PATH |
85dbf7cd MK |
155 | flag is specified in |
156 | .IR flags | |
157 | (see below), | |
158 | then the target file is the one referred to by the file descriptor | |
159 | .IR dirfd . | |
9905e59b DH |
160 | .PP |
161 | .I flags | |
835f4293 | 162 | can be used to influence a pathname-based lookup. |
14b5d02a | 163 | A value for |
9905e59b | 164 | .I flags |
c8701baf | 165 | is constructed by ORing together zero or more of the following constants: |
9905e59b DH |
166 | .TP |
167 | .BR AT_EMPTY_PATH | |
168 | .\" commit 65cfc6722361570bfe255698d9cd4dccaf47570d | |
169 | If | |
170 | .I pathname | |
171 | is an empty string, operate on the file referred to by | |
172 | .IR dirfd | |
173 | (which may have been obtained using the | |
174 | .BR open (2) | |
175 | .B O_PATH | |
176 | flag). | |
85dbf7cd MK |
177 | In this case, |
178 | .I dirfd | |
179 | can refer to any type of file, not just a directory. | |
efeece04 | 180 | .IP |
9905e59b DH |
181 | If |
182 | .I dirfd | |
183 | is | |
184 | .BR AT_FDCWD , | |
185 | the call operates on the current working directory. | |
efeece04 | 186 | .IP |
9905e59b DH |
187 | This flag is Linux-specific; define |
188 | .B _GNU_SOURCE | |
189 | .\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed | |
190 | to obtain its definition. | |
191 | .TP | |
192 | .BR AT_NO_AUTOMOUNT | |
193 | Don't automount the terminal ("basename") component of | |
194 | .I pathname | |
195 | if it is a directory that is an automount point. | |
196 | This allows the caller to gather attributes of an automount point | |
197 | (rather than the location it would mount). | |
198 | This flag can be used in tools that scan directories | |
199 | to prevent mass-automounting of a directory of automount points. | |
200 | The | |
201 | .B AT_NO_AUTOMOUNT | |
202 | flag has no effect if the mount point has already been mounted over. | |
203 | This flag is Linux-specific; define | |
204 | .B _GNU_SOURCE | |
205 | .\" Before glibc 2.16, defining _ATFILE_SOURCE sufficed | |
206 | to obtain its definition. | |
207 | .TP | |
208 | .B AT_SYMLINK_NOFOLLOW | |
209 | If | |
210 | .I pathname | |
211 | is a symbolic link, do not dereference it: | |
212 | instead return information about the link itself, like | |
6a4667aa | 213 | .BR lstat (2). |
9905e59b DH |
214 | .PP |
215 | .I flags | |
14b5d02a MK |
216 | can also be used to control what sort of synchronization the kernel will do |
217 | when querying a file on a remote filesystem. | |
c8701baf | 218 | This is done by ORing in one of the following values: |
9905e59b | 219 | .TP |
709f7bb6 | 220 | .B AT_STATX_SYNC_AS_STAT |
9905e59b | 221 | Do whatever |
6a4667aa | 222 | .BR stat (2) |
14b5d02a | 223 | does. |
56a05af6 | 224 | This is the default and is very much filesystem-specific. |
9905e59b | 225 | .TP |
709f7bb6 | 226 | .B AT_STATX_FORCE_SYNC |
46711e96 | 227 | Force the attributes to be synchronized with the server. |
14b5d02a | 228 | This may require that |
9905e59b DH |
229 | a network filesystem perform a data writeback to get the timestamps correct. |
230 | .TP | |
709f7bb6 | 231 | .B AT_STATX_DONT_SYNC |
46711e96 | 232 | Don't synchronize anything, but rather just take whatever |
ffe297ee | 233 | the system has cached if possible. |
14b5d02a | 234 | This may mean that the information returned is approximate, but, |
9905e59b DH |
235 | on a network filesystem, it may not involve a round trip to the server - even |
236 | if no lease is held. | |
237 | .PP | |
238 | The | |
239 | .I mask | |
240 | argument to | |
241 | .BR statx () | |
242 | is used to tell the kernel which fields the caller is interested in. | |
243 | .I mask | |
c8701baf | 244 | is an ORed combination of the following constants: |
9905e59b DH |
245 | .PP |
246 | .in +4n | |
247 | .TS | |
248 | lB l. | |
249 | STATX_TYPE Want stx_mode & S_IFMT | |
af2d18b2 | 250 | STATX_MODE Want stx_mode & \(tiS_IFMT |
9905e59b DH |
251 | STATX_NLINK Want stx_nlink |
252 | STATX_UID Want stx_uid | |
253 | STATX_GID Want stx_gid | |
f4572b65 MK |
254 | STATX_ATIME Want stx_atime |
255 | STATX_MTIME Want stx_mtime | |
256 | STATX_CTIME Want stx_ctime | |
9905e59b DH |
257 | STATX_INO Want stx_ino |
258 | STATX_SIZE Want stx_size | |
259 | STATX_BLOCKS Want stx_blocks | |
260 | STATX_BASIC_STATS [All of the above] | |
f4572b65 | 261 | STATX_BTIME Want stx_btime |
728009a4 | 262 | STATX_MNT_ID Want stx_mnt_id (since Linux 5.8) |
9905e59b DH |
263 | STATX_ALL [All currently available fields] |
264 | .TE | |
265 | .in | |
266 | .PP | |
c031ffcc | 267 | Note that, in general, the kernel does |
393c5b58 MK |
268 | .I not |
269 | reject values in | |
270 | .I mask | |
271 | other than the above. | |
c031ffcc MK |
272 | (For an exception, see |
273 | .B EINVAL | |
274 | in errors.) | |
393c5b58 MK |
275 | Instead, it simply informs the caller which values are supported |
276 | by this kernel and filesystem via the | |
277 | .I statx.stx_mask | |
278 | field. | |
279 | Therefore, | |
280 | .I "do not" | |
9905e59b DH |
281 | simply set |
282 | .I mask | |
709f7bb6 MK |
283 | to |
284 | .B UINT_MAX | |
393c5b58 | 285 | (all bits set), |
709f7bb6 | 286 | as one or more bits may, in the future, be used to specify an |
9905e59b DH |
287 | extension to the buffer. |
288 | .SS | |
289 | The returned information | |
9905e59b DH |
290 | The status information for the target file is returned in the |
291 | .I statx | |
292 | structure pointed to by | |
15d1f5ac | 293 | .IR statxbuf . |
9905e59b DH |
294 | Included in this is |
295 | .I stx_mask | |
296 | which indicates what other information has been returned. | |
297 | .I stx_mask | |
790314d7 MK |
298 | has the same format as the |
299 | .I mask | |
300 | argument and bits are set in it to indicate | |
9905e59b DH |
301 | which fields have been filled in. |
302 | .PP | |
ffe297ee MK |
303 | It should be noted that the kernel may return fields that weren't |
304 | requested and may fail to return fields that were requested, | |
305 | depending on what the backing filesystem supports. | |
c859dfb5 | 306 | (Fields that are given values despite being unrequested can just be ignored.) |
14b5d02a | 307 | In either case, |
9905e59b DH |
308 | .I stx_mask |
309 | will not be equal | |
310 | .IR mask . | |
311 | .PP | |
ffe297ee MK |
312 | If a filesystem does not support a field or if it has |
313 | an unrepresentable value (for instance, a file with an exotic type), | |
314 | then the mask bit corresponding to that field will be cleared in | |
9905e59b DH |
315 | .I stx_mask |
316 | even if the user asked for it and a dummy value will be filled in for | |
835f4293 | 317 | compatibility purposes if one is available (e.g., a dummy UID and GID may be |
9905e59b DH |
318 | specified to mount under some circumstances). |
319 | .PP | |
320 | A filesystem may also fill in fields that the caller didn't ask for if it has | |
835f4293 | 321 | values for them available and the information is available at no extra cost. |
14b5d02a | 322 | If this happens, the corresponding bits will be set in |
9905e59b DH |
323 | .IR stx_mask . |
324 | .PP | |
9905e59b DH |
325 | .\" Background: inode attributes are modified with i_mutex held, but |
326 | .\" read by stat() without taking the mutex. | |
835f4293 MK |
327 | .IR Note : |
328 | for performance and simplicity reasons, different fields in the | |
9905e59b DH |
329 | .I statx |
330 | structure may contain state information from different moments | |
331 | during the execution of the system call. | |
332 | For example, if | |
333 | .IR stx_mode | |
334 | or | |
335 | .IR stx_uid | |
336 | is changed by another process by calling | |
337 | .BR chmod (2) | |
338 | or | |
339 | .BR chown (2), | |
340 | .BR stat () | |
341 | might return the old | |
342 | .I stx_mode | |
343 | together with the new | |
344 | .IR stx_uid , | |
345 | or the old | |
346 | .I stx_uid | |
347 | together with the new | |
348 | .IR stx_mode . | |
349 | .PP | |
77a09ad7 MK |
350 | Apart from |
351 | .I stx_mask | |
352 | (which is described above), the fields in the | |
9905e59b DH |
353 | .I statx |
354 | structure are: | |
355 | .TP | |
13470fd3 MK |
356 | .I stx_blksize |
357 | The "preferred" block size for efficient filesystem I/O. | |
358 | (Writing to a file in | |
359 | smaller chunks may cause an inefficient read-modify-rewrite.) | |
360 | .TP | |
361 | .I stx_attributes | |
362 | Further status information about the file (see below for more information). | |
363 | .TP | |
364 | .I stx_nlink | |
365 | The number of hard links on a file. | |
366 | .TP | |
367 | .I stx_uid | |
368 | This field contains the user ID of the owner of the file. | |
369 | .TP | |
370 | .I stx_gid | |
371 | This field contains the ID of the group owner of the file. | |
aabbefb4 | 372 | .TP |
9905e59b | 373 | .I stx_mode |
14b5d02a | 374 | The file type and mode. |
19cda35d MK |
375 | See |
376 | .BR inode (7) | |
377 | for details. | |
9905e59b | 378 | .TP |
fc31d730 MK |
379 | .I stx_ino |
380 | The inode number of the file. | |
381 | .TP | |
9905e59b DH |
382 | .I stx_size |
383 | The size of the file (if it is a regular file or a symbolic link) in bytes. | |
ffe297ee MK |
384 | The size of a symbolic link is the length of the pathname it contains, |
385 | without a terminating null byte. | |
9905e59b DH |
386 | .TP |
387 | .I stx_blocks | |
388 | The number of blocks allocated to the file on the medium, in 512-byte units. | |
389 | (This may be smaller than | |
390 | .IR stx_size /512 | |
391 | when the file has holes.) | |
392 | .TP | |
13470fd3 MK |
393 | .I stx_attributes_mask |
394 | A mask indicating which bits in | |
395 | .IR stx_attributes | |
396 | are supported by the VFS and the filesystem. | |
9905e59b DH |
397 | .TP |
398 | .I stx_atime | |
399 | The file's last access timestamp. | |
9905e59b DH |
400 | .TP |
401 | .I stx_btime | |
14b5d02a | 402 | The file's creation timestamp. |
9905e59b DH |
403 | .TP |
404 | .I stx_ctime | |
14b5d02a | 405 | The file's last status change timestamp. |
9905e59b DH |
406 | .TP |
407 | .I stx_mtime | |
14b5d02a | 408 | The file's last modification timestamp. |
13470fd3 MK |
409 | .TP |
410 | .IR stx_dev_major " and " stx_dev_minor | |
411 | The device on which this file (inode) resides. | |
412 | .TP | |
413 | .IR stx_rdev_major " and " stx_rdev_minor | |
414 | The device that this file (inode) represents if the file is of block or | |
415 | character device type. | |
728009a4 N |
416 | .TP |
417 | .I stx_mnt_id | |
418 | .\" commit fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60 | |
053132a8 MK |
419 | The mount ID of the mount containing the file. |
420 | This is the same number reported by | |
728009a4 N |
421 | .BR name_to_handle_at (2) |
422 | and corresponds to the number in the first field in one of the records in | |
423 | .IR /proc/self/mountinfo . | |
9905e59b | 424 | .PP |
19cda35d MK |
425 | For further information on the above fields, see |
426 | .BR inode (7). | |
14b5d02a | 427 | .\" |
9905e59b | 428 | .SS File attributes |
9905e59b DH |
429 | The |
430 | .I stx_attributes | |
c8701baf | 431 | field contains a set of ORed flags that indicate additional attributes |
aabbefb4 MK |
432 | of the file. |
433 | Note that any attribute that is not indicated as supported by | |
434 | .I stx_attributes_mask | |
435 | has no usable value here. | |
436 | The bits in | |
437 | .I stx_attributes_mask | |
438 | correspond bit-by-bit to | |
439 | .IR stx_attributes . | |
efeece04 | 440 | .PP |
aabbefb4 | 441 | The flags are as follows: |
9905e59b | 442 | .TP |
77a09ad7 | 443 | .B STATX_ATTR_COMPRESSED |
56a05af6 MK |
444 | The file is compressed by the filesystem and may take extra resources |
445 | to access. | |
9905e59b | 446 | .TP |
77a09ad7 | 447 | .B STATX_ATTR_IMMUTABLE |
ffe297ee MK |
448 | The file cannot be modified: it cannot be deleted or renamed, |
449 | no hard links can be created to this file and no data can be written to it. | |
709f7bb6 MK |
450 | See |
451 | .BR chattr (1). | |
9905e59b | 452 | .TP |
77a09ad7 | 453 | .B STATX_ATTR_APPEND |
14b5d02a MK |
454 | The file can only be opened in append mode for writing. |
455 | Random access writing | |
456 | is not permitted. | |
709f7bb6 MK |
457 | See |
458 | .BR chattr (1). | |
9905e59b | 459 | .TP |
77a09ad7 | 460 | .B STATX_ATTR_NODUMP |
709f7bb6 MK |
461 | File is not a candidate for backup when a backup program such as |
462 | .BR dump (8) | |
463 | is run. | |
464 | See | |
465 | .BR chattr (1). | |
9905e59b | 466 | .TP |
77a09ad7 | 467 | .B STATX_ATTR_ENCRYPTED |
9905e59b | 468 | A key is required for the file to be encrypted by the filesystem. |
ba2a5200 | 469 | .TP |
c436f71f MK |
470 | .BR STATX_ATTR_VERITY " (since Linux 5.5)" |
471 | .\" commit 3ad2522c64cff1f5aebb987b00683268f0cc7c29 | |
472 | The file has fs-verity enabled. | |
473 | It cannot be written to, and all reads from it will be verified | |
474 | against a cryptographic hash that covers the | |
475 | entire file (e.g., via a Merkle tree). | |
38ad6a88 | 476 | .TP |
2e335632 | 477 | .BR STATX_ATTR_DAX " (since Linux 5.8)" |
c9e6c5ab MK |
478 | The file is in the DAX (cpu direct access) state. |
479 | DAX state attempts to | |
38ad6a88 IW |
480 | minimize software cache effects for both I/O and memory mappings of this file. |
481 | It requires a file system which has been configured to support DAX. | |
2e335632 | 482 | .IP |
c9e6c5ab MK |
483 | DAX generally assumes all accesses are via CPU load / store instructions |
484 | which can minimize overhead for small accesses, | |
485 | but may adversely affect CPU utilization for large transfers. | |
2e335632 | 486 | .IP |
38ad6a88 | 487 | File I/O is done directly to/from user-space buffers and memory mapped I/O may |
c9e6c5ab | 488 | be performed with direct memory mappings that bypass the kernel page cache. |
2e335632 | 489 | .IP |
38ad6a88 | 490 | While the DAX property tends to result in data being transferred synchronously, |
c9e6c5ab MK |
491 | it does not give the same guarantees as the |
492 | .B O_SYNC | |
493 | flag (see | |
494 | .BR open (2)), | |
495 | where data and the necessary metadata are transferred together. | |
2e335632 | 496 | .IP |
c9e6c5ab MK |
497 | A DAX file may support being mapped with the |
498 | .B MAP_SYNC | |
499 | flag, which enables a | |
38ad6a88 IW |
500 | program to use CPU cache flush instructions to persist CPU store operations |
501 | without an explicit | |
c9e6c5ab | 502 | .BR fsync (2). |
38ad6a88 | 503 | See |
c9e6c5ab | 504 | .BR mmap (2) |
38ad6a88 | 505 | for more information. |
9905e59b DH |
506 | .SH RETURN VALUE |
507 | On success, zero is returned. | |
508 | On error, \-1 is returned, and | |
509 | .I errno | |
f6a4078b | 510 | is set to indicate the error. |
9905e59b DH |
511 | .SH ERRORS |
512 | .TP | |
9905e59b DH |
513 | .B EACCES |
514 | Search permission is denied for one of the directories | |
515 | in the path prefix of | |
516 | .IR pathname . | |
517 | (See also | |
518 | .BR path_resolution (7).) | |
519 | .TP | |
520 | .B EBADF | |
9f4e736a MK |
521 | .I pathname |
522 | is relative but | |
9905e59b | 523 | .I dirfd |
9f4e736a MK |
524 | is neither |
525 | .B AT_FDCWD | |
526 | nor a valid file descriptor. | |
9905e59b DH |
527 | .TP |
528 | .B EFAULT | |
09ff9f4a MK |
529 | .I pathname |
530 | or | |
15d1f5ac | 531 | .I statxbuf |
09ff9f4a MK |
532 | is NULL or points to a location outside the process's |
533 | accessible address space. | |
9905e59b | 534 | .TP |
1b206bd8 MK |
535 | .B EINVAL |
536 | Invalid flag specified in | |
537 | .IR flags . | |
538 | .TP | |
aabbefb4 MK |
539 | .B EINVAL |
540 | Reserved flag specified in | |
541 | .IR mask . | |
c031ffcc MK |
542 | (Currently, there is one such flag, designated by the constant |
543 | .BR STATX__RESERVED , | |
544 | with the value 0x80000000U.) | |
aabbefb4 | 545 | .TP |
9905e59b | 546 | .B ELOOP |
835f4293 | 547 | Too many symbolic links encountered while traversing the pathname. |
9905e59b DH |
548 | .TP |
549 | .B ENAMETOOLONG | |
550 | .I pathname | |
551 | is too long. | |
552 | .TP | |
553 | .B ENOENT | |
554 | A component of | |
555 | .I pathname | |
556 | does not exist, or | |
557 | .I pathname | |
c8701baf MK |
558 | is an empty string and |
559 | .B AT_EMPTY_PATH | |
560 | was not specified in | |
561 | .IR flags . | |
9905e59b DH |
562 | .TP |
563 | .B ENOMEM | |
564 | Out of memory (i.e., kernel memory). | |
565 | .TP | |
566 | .B ENOTDIR | |
567 | A component of the path prefix of | |
568 | .I pathname | |
569 | is not a directory or | |
570 | .I pathname | |
571 | is relative and | |
572 | .I dirfd | |
573 | is a file descriptor referring to a file other than a directory. | |
574 | .SH VERSIONS | |
575 | .BR statx () | |
e06763fe | 576 | was added to Linux in kernel 4.11; library support was added in glibc 2.28. |
7a192d0d MK |
577 | .SH CONFORMING TO |
578 | .BR statx () | |
56a05af6 | 579 | is Linux-specific. |
9905e59b DH |
580 | .SH SEE ALSO |
581 | .BR ls (1), | |
582 | .BR stat (1), | |
583 | .BR access (2), | |
584 | .BR chmod (2), | |
585 | .BR chown (2), | |
728009a4 | 586 | .BR name_to_handle_at (2), |
9905e59b | 587 | .BR readlink (2), |
6edadda6 | 588 | .BR stat (2), |
9905e59b | 589 | .BR utime (2), |
728009a4 | 590 | .BR proc (5), |
9905e59b | 591 | .BR capabilities (7), |
3b363b62 | 592 | .BR inode (7), |
9905e59b | 593 | .BR symlink (7) |