]>
git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/headers/public/__header_fcntl.h
1 #ifndef __wasilibc___header_fcntl_h
2 #define __wasilibc___header_fcntl_h
8 #define O_APPEND __WASI_FDFLAGS_APPEND
9 #define O_DSYNC __WASI_FDFLAGS_DSYNC
10 #define O_NONBLOCK __WASI_FDFLAGS_NONBLOCK
11 #define O_RSYNC __WASI_FDFLAGS_RSYNC
12 #define O_SYNC __WASI_FDFLAGS_SYNC
13 #define O_CREAT (__WASI_OFLAGS_CREAT << 12)
14 #define O_DIRECTORY (__WASI_OFLAGS_DIRECTORY << 12)
15 #define O_EXCL (__WASI_OFLAGS_EXCL << 12)
16 #define O_TRUNC (__WASI_OFLAGS_TRUNC << 12)
18 #define O_NOFOLLOW (0x01000000)
19 #define O_EXEC (0x02000000)
20 #define O_RDONLY (0x04000000)
21 #define O_SEARCH (0x08000000)
22 #define O_WRONLY (0x10000000)
25 * O_CLOEXEC is defined to be zero, as WASI has no exec-style functions.
30 * O_TTY_INIT is defined to be zero, meaning that WASI implementations are
31 * expected to always initialize a terminal the first time it's opened.
33 #define O_TTY_INIT (0)
37 #define O_RDWR (O_RDONLY | O_WRONLY)
38 #define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH)
40 #define POSIX_FADV_DONTNEED __WASI_ADVICE_DONTNEED
41 #define POSIX_FADV_NOREUSE __WASI_ADVICE_NOREUSE
42 #define POSIX_FADV_NORMAL __WASI_ADVICE_NORMAL
43 #define POSIX_FADV_RANDOM __WASI_ADVICE_RANDOM
44 #define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL
45 #define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED
52 #define FD_CLOEXEC (1)
54 #define AT_EACCESS (0x0)
55 #define AT_SYMLINK_NOFOLLOW (0x1)
56 #define AT_SYMLINK_FOLLOW (0x2)
57 #define AT_REMOVEDIR (0x4)