Skip to content

Commit 1fb1f08

Browse files
dkegel-fastlyaykevl
authored andcommitted
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.
1 parent 0b5d300 commit 1fb1f08

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/syscall/syscall_libc_wasi.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ const (
5959
O_SYNC = __WASI_FDFLAGS_SYNC
6060

6161
O_CLOEXEC = 0
62+
63+
// ../../lib/wasi-libc/sysroot/include/sys/mman.h
64+
MAP_FILE = 0
65+
MAP_SHARED = 0x01
66+
MAP_PRIVATE = 0x02
67+
MAP_ANON = 0x20
68+
MAP_ANONYMOUS = MAP_ANON
69+
70+
// ../../lib/wasi-libc/sysroot/include/sys/mman.h
71+
PROT_NONE = 0
72+
PROT_READ = 1
73+
PROT_WRITE = 2
74+
PROT_EXEC = 4
6275
)
6376

6477
//go:extern errno

0 commit comments

Comments
 (0)