awk portability
[m6w6/ext-psi] / m4 / sys_stat.m4
1 AC_DEFUN(PSI_CHECK_SYS_STAT, [
2 AC_CHECK_HEADERS([sys/stat.h])
3
4 PSI_STRUCT(struct stat, [
5 dev_t st_dev,
6 ino_t st_ino,
7 mode_t st_mode,
8 nlink_t st_nlink,
9 uid_t st_uid,
10 gid_t st_gid,
11 dev_t st_rdev,
12 off_t st_size,
13 blksize_t st_blksize,
14 blkcnt_t st_blocks,
15 time_t st_atime,
16 time_t st_mtime,
17 time_t st_ctime,
18 struct timespec st_atim,
19 struct timespec st_mtim,
20 struct timespec st_ctim,
21 struct timespec st_atimespec,
22 struct timespec st_mtimespec,
23 struct timespec st_ctimespec,
24 struct timespec st_birthtimespec,
25 time_t st_birthtime,
26 int st_flags,
27 int st_gen]
28 )
29
30 PSI_CONST(S_IFMT, int)
31 PSI_CONST(S_IFBLK, int)
32 PSI_CONST(S_IFCHR, int)
33 PSI_CONST(S_IFIFO, int)
34 PSI_CONST(S_IFREG, int)
35 PSI_CONST(S_IFDIR, int)
36 PSI_CONST(S_IFLNK, int)
37 PSI_CONST(S_IFSOCK, int)
38 PSI_CONST(S_IRWXU, int)
39 PSI_CONST(S_IRUSR, int)
40 PSI_CONST(S_IWUSR, int)
41 PSI_CONST(S_IXUSR, int)
42 PSI_CONST(S_IRWXG, int)
43 PSI_CONST(S_IRGRP, int)
44 PSI_CONST(S_IWGRP, int)
45 PSI_CONST(S_IXGRP, int)
46 PSI_CONST(S_IRWXO, int)
47 PSI_CONST(S_IROTH, int)
48 PSI_CONST(S_IWOTH, int)
49 PSI_CONST(S_IXOTH, int)
50 PSI_CONST(S_ISUID, int)
51 PSI_CONST(S_ISGID, int)
52 PSI_CONST(UTIME_NOW, int)
53 PSI_CONST(UTIME_OMIT, int)
54
55 PSI_MACRO(int S_ISBLK, [(mode_t m)])
56 PSI_MACRO(int S_ISCHR, [(mode_t m)])
57 PSI_MACRO(int S_ISDIR, [(mode_t m)])
58 PSI_MACRO(int S_ISFIFO, [(mode_t m)])
59 PSI_MACRO(int S_ISREG, [(mode_t m)])
60 PSI_MACRO(int S_ISLNK, [(mode_t m)])
61 PSI_MACRO(int S_ISSOCK, [(mode_t m)])
62
63 PSI_MACRO(int S_TYPEISMQ, [(struct stat *s)])
64 PSI_MACRO(int S_TYPEISSEM, [(struct stat *s)])
65 PSI_MACRO(int S_TYPEISSHM, [(struct stat *s)])
66 PSI_MACRO(int S_TYPEISTMO, [(struct stat *s)])
67
68 PSI_DECL(int chmod, [(char *path, mode_t mode)])
69 PSI_DECL(int fchmod, [(int fd, mode_t mode)])
70 PSI_DECL(int fchmodat, [(int fd, char *path, mode_t mode, int flag)])
71 PSI_DECL(int fstat, [(int fd, struct stat *buf)])
72 PSI_DECL(int fstatat, [(int fd, char *path, struct stat *buf, int flag)])
73 PSI_DECL(int futimens, [(int fd, struct timespec times@<:@2@:>@)])
74 PSI_DECL(int lstat, [(char *path, struct stat *buf)])
75 PSI_DECL(int mkdir, [(char *path, mode_t mode)])
76 PSI_DECL(int mkdirat, [(int fd, char *path, mode_t mode)])
77 PSI_DECL(int mkfifo, [(char *path, mode_t mode)])
78 PSI_DECL(int mkfifoat, [(int fd, char *path, mode_t mode)])
79 PSI_DECL(int mknod, [(char *path, mode_t mode, dev_t dev)])
80 PSI_DECL(int mknodat, [(int fd, char *path, mode_t mode, dev_t dev)])
81 PSI_DECL(int stat, [(char *path, struct stat *buf)])
82 PSI_DECL(mode_t umask, [(mode_t mode)])
83 PSI_DECL(int utimensat, [(int fd, char *path, struct timespec times@<:@2@:>@, int flag)])
84 ])