12 #define __NEED_nlink_t
17 #define __NEED_blksize_t
18 #define __NEED_blkcnt_t
19 #define __NEED_struct_timespec
21 #include <bits/alltypes.h>
23 #include <bits/stat.h>
25 #define st_atime st_atim.tv_sec
26 #define st_mtime st_mtim.tv_sec
27 #define st_ctime st_ctim.tv_sec
29 #define S_IFMT 0170000
31 #define S_IFDIR 0040000
32 #define S_IFCHR 0020000
33 #define S_IFBLK 0060000
34 #define S_IFREG 0100000
35 #define S_IFIFO 0010000
36 #define S_IFLNK 0120000
37 #define S_IFSOCK 0140000
39 #define S_TYPEISMQ(buf) 0
40 #define S_TYPEISSEM(buf) 0
41 #define S_TYPEISSHM(buf) 0
42 #define S_TYPEISTMO(buf) 0
44 #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
45 #define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
46 #define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
47 #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
48 #define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
49 #define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
50 #define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
70 #define UTIME_NOW 0x3fffffff
71 #define UTIME_OMIT 0x3ffffffe
73 int stat(const char *__restrict
, struct stat
*__restrict
);
74 int fstat(int, struct stat
*);
75 int lstat(const char *__restrict
, struct stat
*__restrict
);
76 int fstatat(int, const char *__restrict
, struct stat
*__restrict
, int);
77 int chmod(const char *, mode_t
);
78 int fchmod(int, mode_t
);
79 int fchmodat(int, const char *, mode_t
, int);
81 int mkdir(const char *, mode_t
);
82 int mkfifo(const char *, mode_t
);
83 int mkdirat(int, const char *, mode_t
);
84 int mkfifoat(int, const char *, mode_t
);
86 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
87 int mknod(const char *, mode_t
, dev_t
);
88 int mknodat(int, const char *, mode_t
, dev_t
);
91 int futimens(int, const struct timespec
[2]);
92 int utimensat(int, const char *, const struct timespec
[2], int);
94 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
95 int lchmod(const char *, mode_t
);
96 #define S_IREAD S_IRUSR
97 #define S_IWRITE S_IWUSR
98 #define S_IEXEC S_IXUSR
101 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
103 #define fstat64 fstat
104 #define lstat64 lstat
105 #define fstatat64 fstatat
106 #define blkcnt64_t blkcnt_t
107 #define fsblkcnt64_t fsblkcnt_t
108 #define fsfilcnt64_t fsfilcnt_t
109 #define ino64_t ino_t
110 #define off64_t off_t
114 __REDIR(stat
, __stat_time64
);
115 __REDIR(fstat
, __fstat_time64
);
116 __REDIR(lstat
, __lstat_time64
);
117 __REDIR(fstatat
, __fstatat_time64
);
118 __REDIR(futimens
, __futimens_time64
);
119 __REDIR(utimensat
, __utimensat_time64
);