Skip to content

syscall: add WASI {D,R}SYNC, NONBLOCK FD flags #3052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions src/syscall/syscall_libc_wasi.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,29 @@ const (
)

const (
__WASI_OFLAGS_CREAT = 1
__WASI_FDFLAGS_APPEND = 1
__WASI_OFLAGS_EXCL = 4
__WASI_OFLAGS_TRUNC = 8
__WASI_FDFLAGS_SYNC = 16
__WASI_OFLAGS_CREAT = 1
__WASI_OFLAGS_EXCL = 4
__WASI_OFLAGS_TRUNC = 8

__WASI_FDFLAGS_APPEND = 1
__WASI_FDFLAGS_DSYNC = 2
__WASI_FDFLAGS_NONBLOCK = 4
__WASI_FDFLAGS_RSYNC = 8
__WASI_FDFLAGS_SYNC = 16

O_RDONLY = 0x04000000
O_WRONLY = 0x10000000
O_RDWR = O_RDONLY | O_WRONLY

O_CREAT = __WASI_OFLAGS_CREAT << 12
O_TRUNC = __WASI_OFLAGS_TRUNC << 12
O_APPEND = __WASI_FDFLAGS_APPEND
O_EXCL = __WASI_OFLAGS_EXCL << 12
O_SYNC = __WASI_FDFLAGS_SYNC
O_CREAT = __WASI_OFLAGS_CREAT << 12
O_TRUNC = __WASI_OFLAGS_TRUNC << 12
O_EXCL = __WASI_OFLAGS_EXCL << 12

O_APPEND = __WASI_FDFLAGS_APPEND
O_DSYNC = __WASI_FDFLAGS_DSYNC
O_NONBLOCK = __WASI_FDFLAGS_NONBLOCK
O_RSYNC = __WASI_FDFLAGS_RSYNC
O_SYNC = __WASI_FDFLAGS_SYNC

O_CLOEXEC = 0

Expand Down