diff options
author | Dan Kegel <[email protected]> | 2022-03-18 09:23:35 -0700 |
---|---|---|
committer | Ayke <[email protected]> | 2022-03-19 16:05:23 +0100 |
commit | 1fb1f082331cafc5b6734b9e24f2838c5634a62f (patch) | |
tree | 4300f792c0aca013ce1d97b17f15559bc3ec9753 /src/syscall/syscall_libc_wasi.go | |
parent | 0b5d300d9480cfdd6828e054bda50596a39782de (diff) | |
download | tinygo-1fb1f082331cafc5b6734b9e24f2838c5634a62f.tar.gz tinygo-1fb1f082331cafc5b6734b9e24f2838c5634a62f.zip |
syscall: define MAP_SHARED and PROT_READ on wasi
Makes 1.18 tests a little happier.
Not sure mmap works on wasi, so these may be somewhat stubby.
Diffstat (limited to 'src/syscall/syscall_libc_wasi.go')
-rw-r--r-- | src/syscall/syscall_libc_wasi.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/syscall/syscall_libc_wasi.go b/src/syscall/syscall_libc_wasi.go index cf556884d..3d4e8111d 100644 --- a/src/syscall/syscall_libc_wasi.go +++ b/src/syscall/syscall_libc_wasi.go @@ -59,6 +59,19 @@ const ( O_SYNC = __WASI_FDFLAGS_SYNC O_CLOEXEC = 0 + + // ../../lib/wasi-libc/sysroot/include/sys/mman.h + MAP_FILE = 0 + MAP_SHARED = 0x01 + MAP_PRIVATE = 0x02 + MAP_ANON = 0x20 + MAP_ANONYMOUS = MAP_ANON + + // ../../lib/wasi-libc/sysroot/include/sys/mman.h + PROT_NONE = 0 + PROT_READ = 1 + PROT_WRITE = 2 + PROT_EXEC = 4 ) //go:extern errno |