]> git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/headers/public/__header_sys_stat.h
063b71227baa8269596c630de3feb0fd5af7aa1f
[wasi-libc.git] / libc-bottom-half / headers / public / __header_sys_stat.h
1 #ifndef __wasilibc___header_sys_stat_h
2 #define __wasilibc___header_sys_stat_h
3
4 #include <__struct_stat.h>
5
6 #define st_atime st_atim.tv_sec
7 #define st_mtime st_mtim.tv_sec
8 #define st_ctime st_ctim.tv_sec
9
10 #define S_IFMT \
11 (S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK)
12 #define S_IFBLK (0x6000)
13 #define S_IFCHR (0x2000)
14 #define S_IFDIR (0x4000)
15 #define S_IFLNK (0xa000)
16 #define S_IFREG (0x8000)
17 #define S_IFSOCK (0xc000)
18 #define S_IFIFO (0xc000)
19
20 #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
21 #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
22 #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
23 #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
24 #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
25 #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
26 #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
27
28 #define S_IXOTH (0x1)
29 #define S_IWOTH (0x2)
30 #define S_IROTH (0x4)
31 #define S_IRWXO (S_IXOTH | S_IWOTH | S_IROTH)
32 #define S_IXGRP (0x8)
33 #define S_IWGRP (0x10)
34 #define S_IRGRP (0x20)
35 #define S_IRWXG (S_IXGRP | S_IWGRP | S_IRGRP)
36 #define S_IXUSR (0x40)
37 #define S_IWUSR (0x80)
38 #define S_IRUSR (0x100)
39 #define S_IRWXU (S_IXUSR | S_IWUSR | S_IRUSR)
40 #define S_ISVTX (0x200)
41 #define S_ISGID (0x400)
42 #define S_ISUID (0x800)
43
44 #define UTIME_NOW (-1)
45 #define UTIME_OMIT (-2)
46
47 #endif