12 #define __NEED_nlink_t
17 #define __NEED_blksize_t
18 #define __NEED_blkcnt_t
19 #define __NEED_struct_timespec
22 #define __NEED_int64_t
23 #define __NEED_uint64_t
24 #define __NEED_uint32_t
25 #define __NEED_uint16_t
28 #include <bits/alltypes.h>
30 #include <bits/stat.h>
32 #define st_atime st_atim.tv_sec
33 #define st_mtime st_mtim.tv_sec
34 #define st_ctime st_ctim.tv_sec
36 #define S_IFMT 0170000
38 #define S_IFDIR 0040000
39 #define S_IFCHR 0020000
40 #define S_IFBLK 0060000
41 #define S_IFREG 0100000
42 #define S_IFIFO 0010000
43 #define S_IFLNK 0120000
44 #define S_IFSOCK 0140000
46 #define S_TYPEISMQ(buf) 0
47 #define S_TYPEISSEM(buf) 0
48 #define S_TYPEISSHM(buf) 0
49 #define S_TYPEISTMO(buf) 0
51 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
52 #define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
53 #define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
54 #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
55 #define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
56 #define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
57 #define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
77 #define UTIME_NOW 0x3fffffff
78 #define UTIME_OMIT 0x3ffffffe
80 int stat(const char *__restrict
, struct stat
*__restrict
);
81 int fstat(int, struct stat
*);
82 int lstat(const char *__restrict
, struct stat
*__restrict
);
83 int fstatat(int, const char *__restrict
, struct stat
*__restrict
, int);
84 int chmod(const char *, mode_t
);
85 int fchmod(int, mode_t
);
86 int fchmodat(int, const char *, mode_t
, int);
88 int mkdir(const char *, mode_t
);
89 int mkfifo(const char *, mode_t
);
90 int mkdirat(int, const char *, mode_t
);
91 int mkfifoat(int, const char *, mode_t
);
93 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
94 int mknod(const char *, mode_t
, dev_t
);
95 int mknodat(int, const char *, mode_t
, dev_t
);
98 int futimens(int, const struct timespec
[2]);
99 int utimensat(int, const char *, const struct timespec
[2], int);
101 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
102 int lchmod(const char *, mode_t
);
103 #define S_IREAD S_IRUSR
104 #define S_IWRITE S_IWUSR
105 #define S_IEXEC S_IXUSR
108 #if defined(_GNU_SOURCE)
109 #define STATX_TYPE 1U
110 #define STATX_MODE 2U
111 #define STATX_NLINK 4U
113 #define STATX_GID 0x10U
114 #define STATX_ATIME 0x20U
115 #define STATX_MTIME 0x40U
116 #define STATX_CTIME 0x80U
117 #define STATX_INO 0x100U
118 #define STATX_SIZE 0x200U
119 #define STATX_BLOCKS 0x400U
120 #define STATX_BASIC_STATS 0x7ffU
121 #define STATX_BTIME 0x800U
122 #define STATX_ALL 0xfffU
124 #define STATX_ATTR_COMPRESSED 0x4
125 #define STATX_ATTR_IMMUTABLE 0x10
126 #define STATX_ATTR_APPEND 0x20
127 #define STATX_ATTR_NODUMP 0x40
128 #define STATX_ATTR_ENCRYPTED 0x800
129 #define STATX_ATTR_AUTOMOUNT 0x1000
130 #define STATX_ATTR_MOUNT_ROOT 0x2000
131 #define STATX_ATTR_VERITY 0x100000
132 #define STATX_ATTR_DAX 0x200000
134 struct statx_timestamp
{
136 uint32_t tv_nsec
, __pad
;
141 uint32_t stx_blksize
;
142 uint64_t stx_attributes
;
151 uint64_t stx_attributes_mask
;
152 struct statx_timestamp stx_atime
;
153 struct statx_timestamp stx_btime
;
154 struct statx_timestamp stx_ctime
;
155 struct statx_timestamp stx_mtime
;
156 uint32_t stx_rdev_major
;
157 uint32_t stx_rdev_minor
;
158 uint32_t stx_dev_major
;
159 uint32_t stx_dev_minor
;
163 int statx(int, const char *__restrict
, int, unsigned, struct statx
*__restrict
);
166 #if defined(_LARGEFILE64_SOURCE)
168 #define fstat64 fstat
169 #define lstat64 lstat
170 #define fstatat64 fstatat
171 #define blkcnt64_t blkcnt_t
172 #define fsblkcnt64_t fsblkcnt_t
173 #define fsfilcnt64_t fsfilcnt_t
174 #define ino64_t ino_t
175 #define off64_t off_t
179 __REDIR(stat
, __stat_time64
);
180 __REDIR(fstat
, __fstat_time64
);
181 __REDIR(lstat
, __lstat_time64
);
182 __REDIR(fstatat
, __fstatat_time64
);
183 __REDIR(futimens
, __futimens_time64
);
184 __REDIR(utimensat
, __utimensat_time64
);