wasi-libc
wasi-libc copied to clipboard
_WASI_EMULATED_MMAN is doesn't write changes back to the underlying file
The munmap
is supposed to do this, but also msync
is completely missing.
The
munmap
is supposed to do this, but alsomsync
is completely missing.
Same, trying to close my shared memory with 'munmap' and it's not writing to the file even though it works when compiled with emscripten or natively. Were you able to find a solution ?
Implementing these turned out to hit the limitation that wasip1 doesn't have dup
, so the emulated mmap
can't save the file descriptor to be able to write back into it.
One solution is to change the code to just use file reads and writes, instead of mmap
, since that's what the emulated mmap here (and in Emscripten too) does under the covers anyway.