]> git.proxmox.com Git - wasi-libc.git/commit
add stubs for `statvfs`, `chmod`, etc. (#463)
authorJoel Dice <joel.dice@fermyon.com>
Thu, 11 Jan 2024 20:16:59 +0000 (13:16 -0700)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 25 Jun 2024 10:13:35 +0000 (12:13 +0200)
commit9d4742c78dbfcd590b4b7f7ce5646db35235eb80
treee674b9dd9346b2df500a3beeadf2746cec528f5c
parent5506542244d2c0bc7e93670286abdcc3b6ef5274
add stubs for `statvfs`, `chmod`, etc. (#463)

Per https://github.com/WebAssembly/wasi-sdk/issues/373, LLVM's libc++ no longer
allows us to enable `<fstream>` and `<filesystem>` separately -- it's both or
neither.  Consequently, we either need to patch libc++ to not use `statvfs`,
`chmod`, etc. or add stub functions for those features to `wasi-libc`.  Since
we're planning to eventually support those features with WASI Preview 2 and
beyond, it makes sense to do the latter.

Note that since libc++ uses `DT_SOCK`, I've added a definition for it -- even
though WASI Preview 1 does not define it.  No Preview 1 file will ever have that
type, so code that handles that type will never be reached, but defining it
allows us to avoid WASI-specific patches to libc++.

Related to `DT_SOCK`, I had to change the `S_IFIFO` value so it does not
conflict with `S_IFSOCK`, thereby avoiding ambiguity in `__wasilibc_iftodt`.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
15 files changed:
Makefile
expected/wasm32-wasi-preview2/defined-symbols.txt
expected/wasm32-wasi-preview2/include-all.c
expected/wasm32-wasi-preview2/predefined-macros.txt
expected/wasm32-wasi-threads/defined-symbols.txt
expected/wasm32-wasi-threads/include-all.c
expected/wasm32-wasi-threads/predefined-macros.txt
expected/wasm32-wasi/defined-symbols.txt
expected/wasm32-wasi/include-all.c
expected/wasm32-wasi/predefined-macros.txt
libc-bottom-half/headers/public/__header_dirent.h
libc-bottom-half/headers/public/__mode_t.h
libc-bottom-half/sources/posix.c
libc-top-half/musl/include/stdlib.h
libc-top-half/musl/include/sys/stat.h