emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.37k stars 3.25k forks source link

WasmFS: How much POSIX magic directory stuff do we want? #19430

Open kripken opened 1 year ago

kripken commented 1 year ago

E.g. test_proc_self_fd tests for opening the directory /proc/self/fd/, under which each file descriptor appears as a file. I suspect this is needed pretty rarely, and should probably be an opt-in flag for maximal POSIX support or such.

Perhaps the /tmp/ and /dev/[null|stdout|random..] files/directories could also be behind such a flag, but those do seem like they are much more commonly used, and we support them atm.

tlively commented 1 year ago

+1 for supporting as many of these special files as possible on an opt-in basis.

kripken commented 1 year ago

I wonder if maybe we can use the existing FORCE_FILESYSTEM flag for this. It already means "include the full set of FS support in JS" so maybe it could mean the same for the POSIX side too. People that are ok with the code size downsides of one are likely ok with the other, I'm thinking.