Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_STAT_H |
| 8 | #define _UAPI_LINUX_STAT_H |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 9 | #include <linux/types.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 10 | #if !defined(__GLIBC__) || __GLIBC__ < 2 |
| 11 | #define S_IFMT 00170000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 12 | #define S_IFSOCK 0140000 |
| 13 | #define S_IFLNK 0120000 |
| 14 | #define S_IFREG 0100000 |
| 15 | #define S_IFBLK 0060000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 16 | #define S_IFDIR 0040000 |
| 17 | #define S_IFCHR 0020000 |
| 18 | #define S_IFIFO 0010000 |
| 19 | #define S_ISUID 0004000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 20 | #define S_ISGID 0002000 |
| 21 | #define S_ISVTX 0001000 |
| 22 | #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) |
| 23 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) |
| 25 | #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) |
| 26 | #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) |
| 27 | #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) |
| 29 | #define S_IRWXU 00700 |
| 30 | #define S_IRUSR 00400 |
| 31 | #define S_IWUSR 00200 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | #define S_IXUSR 00100 |
| 33 | #define S_IRWXG 00070 |
| 34 | #define S_IRGRP 00040 |
| 35 | #define S_IWGRP 00020 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define S_IXGRP 00010 |
| 37 | #define S_IRWXO 00007 |
| 38 | #define S_IROTH 00004 |
| 39 | #define S_IWOTH 00002 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | #define S_IXOTH 00001 |
| 41 | #endif |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 42 | struct statx_timestamp { |
| 43 | __s64 tv_sec; |
| 44 | __u32 tv_nsec; |
| 45 | __s32 __reserved; |
| 46 | }; |
| 47 | struct statx { |
| 48 | __u32 stx_mask; |
| 49 | __u32 stx_blksize; |
| 50 | __u64 stx_attributes; |
| 51 | __u32 stx_nlink; |
| 52 | __u32 stx_uid; |
| 53 | __u32 stx_gid; |
| 54 | __u16 stx_mode; |
| 55 | __u16 __spare0[1]; |
| 56 | __u64 stx_ino; |
| 57 | __u64 stx_size; |
| 58 | __u64 stx_blocks; |
| 59 | __u64 stx_attributes_mask; |
| 60 | struct statx_timestamp stx_atime; |
| 61 | struct statx_timestamp stx_btime; |
| 62 | struct statx_timestamp stx_ctime; |
| 63 | struct statx_timestamp stx_mtime; |
| 64 | __u32 stx_rdev_major; |
| 65 | __u32 stx_rdev_minor; |
| 66 | __u32 stx_dev_major; |
| 67 | __u32 stx_dev_minor; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 68 | __u64 stx_mnt_id; |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 69 | __u32 stx_dio_mem_align; |
| 70 | __u32 stx_dio_offset_align; |
Christopher Ferris | 7ac54f5 | 2024-08-07 21:07:12 +0000 | [diff] [blame] | 71 | __u64 stx_subvol; |
| 72 | __u64 __spare3[11]; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 73 | }; |
| 74 | #define STATX_TYPE 0x00000001U |
| 75 | #define STATX_MODE 0x00000002U |
| 76 | #define STATX_NLINK 0x00000004U |
| 77 | #define STATX_UID 0x00000008U |
| 78 | #define STATX_GID 0x00000010U |
| 79 | #define STATX_ATIME 0x00000020U |
| 80 | #define STATX_MTIME 0x00000040U |
| 81 | #define STATX_CTIME 0x00000080U |
| 82 | #define STATX_INO 0x00000100U |
| 83 | #define STATX_SIZE 0x00000200U |
| 84 | #define STATX_BLOCKS 0x00000400U |
| 85 | #define STATX_BASIC_STATS 0x000007ffU |
| 86 | #define STATX_BTIME 0x00000800U |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 87 | #define STATX_MNT_ID 0x00001000U |
Christopher Ferris | 6cd53a5 | 2022-12-12 23:39:16 +0000 | [diff] [blame] | 88 | #define STATX_DIOALIGN 0x00002000U |
Christopher Ferris | b830ddf | 2024-03-28 11:48:08 -0700 | [diff] [blame] | 89 | #define STATX_MNT_ID_UNIQUE 0x00004000U |
Christopher Ferris | 7ac54f5 | 2024-08-07 21:07:12 +0000 | [diff] [blame] | 90 | #define STATX_SUBVOL 0x00008000U |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 91 | #define STATX__RESERVED 0x80000000U |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 92 | #define STATX_ALL 0x00000fffU |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 93 | #define STATX_ATTR_COMPRESSED 0x00000004 |
| 94 | #define STATX_ATTR_IMMUTABLE 0x00000010 |
| 95 | #define STATX_ATTR_APPEND 0x00000020 |
| 96 | #define STATX_ATTR_NODUMP 0x00000040 |
| 97 | #define STATX_ATTR_ENCRYPTED 0x00000800 |
| 98 | #define STATX_ATTR_AUTOMOUNT 0x00001000 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 99 | #define STATX_ATTR_MOUNT_ROOT 0x00002000 |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 100 | #define STATX_ATTR_VERITY 0x00100000 |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 101 | #define STATX_ATTR_DAX 0x00200000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 102 | #endif |