1 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 2 #pragma once 3 4 #include <linux/types.h> 5 #include <sys/stat.h> 6 7 #if WANT_LINUX_STAT_H 8 #include <linux/stat.h> 9 #endif 10 11 /* Thew newest definition we are aware of (fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60; 5.8) */ 12 #define STATX_DEFINITION { \ 13 __u32 stx_mask; \ 14 __u32 stx_blksize; \ 15 __u64 stx_attributes; \ 16 __u32 stx_nlink; \ 17 __u32 stx_uid; \ 18 __u32 stx_gid; \ 19 __u16 stx_mode; \ 20 __u16 __spare0[1]; \ 21 __u64 stx_ino; \ 22 __u64 stx_size; \ 23 __u64 stx_blocks; \ 24 __u64 stx_attributes_mask; \ 25 struct statx_timestamp stx_atime; \ 26 struct statx_timestamp stx_btime; \ 27 struct statx_timestamp stx_ctime; \ 28 struct statx_timestamp stx_mtime; \ 29 __u32 stx_rdev_major; \ 30 __u32 stx_rdev_minor; \ 31 __u32 stx_dev_major; \ 32 __u32 stx_dev_minor; \ 33 __u64 stx_mnt_id; \ 34 __u64 __spare2; \ 35 __u64 __spare3[12]; \ 36 } 37 38 #if !HAVE_STRUCT_STATX 39 struct statx_timestamp { 40 __s64 tv_sec; 41 __u32 tv_nsec; 42 __s32 __reserved; 43 }; 44 45 struct statx STATX_DEFINITION; 46 #endif 47 48 /* Always define the newest version we are aware of as a distinct type, so that we can use it even if glibc 49 * defines an older definition */ 50 struct new_statx STATX_DEFINITION; 51 52 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 53 #ifndef AT_STATX_SYNC_AS_STAT 54 #define AT_STATX_SYNC_AS_STAT 0x0000 55 #endif 56 57 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 58 #ifndef AT_STATX_FORCE_SYNC 59 #define AT_STATX_FORCE_SYNC 0x2000 60 #endif 61 62 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 63 #ifndef AT_STATX_DONT_SYNC 64 #define AT_STATX_DONT_SYNC 0x4000 65 #endif 66 67 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 68 #ifndef STATX_TYPE 69 #define STATX_TYPE 0x00000001U 70 #endif 71 72 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 73 #ifndef STATX_MODE 74 #define STATX_MODE 0x00000002U 75 #endif 76 77 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 78 #ifndef STATX_NLINK 79 #define STATX_NLINK 0x00000004U 80 #endif 81 82 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 83 #ifndef STATX_UID 84 #define STATX_UID 0x00000008U 85 #endif 86 87 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 88 #ifndef STATX_GID 89 #define STATX_GID 0x00000010U 90 #endif 91 92 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 93 #ifndef STATX_ATIME 94 #define STATX_ATIME 0x00000020U 95 #endif 96 97 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 98 #ifndef STATX_MTIME 99 #define STATX_MTIME 0x00000040U 100 #endif 101 102 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 103 #ifndef STATX_CTIME 104 #define STATX_CTIME 0x00000080U 105 #endif 106 107 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 108 #ifndef STATX_INO 109 #define STATX_INO 0x00000100U 110 #endif 111 112 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 113 #ifndef STATX_SIZE 114 #define STATX_SIZE 0x00000200U 115 #endif 116 117 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 118 #ifndef STATX_BLOCKS 119 #define STATX_BLOCKS 0x00000400U 120 #endif 121 122 /* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */ 123 #ifndef STATX_BTIME 124 #define STATX_BTIME 0x00000800U 125 #endif 126 127 /* fa2fcf4f1df1559a0a4ee0f46915b496cc2ebf60 (5.8) */ 128 #ifndef STATX_MNT_ID 129 #define STATX_MNT_ID 0x00001000U 130 #endif 131 132 /* 80340fe3605c0e78cfe496c3b3878be828cfdbfe (5.8) */ 133 #ifndef STATX_ATTR_MOUNT_ROOT 134 #define STATX_ATTR_MOUNT_ROOT 0x00002000 /* Root of a mount */ 135 #endif 136