-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite the preopen functionality to be simpler, better organized, and better integrated into WASI libc. Preopen support has diverged so much from libpreopen that it no longer makes sense to track libpreopen as an explicit upstream. And add more documentation.
- Loading branch information
1 parent
e1149ab
commit 7edebdf
Showing
8 changed files
with
488 additions
and
590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
"WASI" the WebAssembly System Interface. | ||
# WASI libc "bottom half". | ||
|
||
WASI libc is conceptually the lower half of a traditional libc implementation. | ||
It provides C interfaces to the low-level WASI syscalls. | ||
The WASI libc "bottom half" is conceptually the lower half of a traditional libc | ||
implementation, consisting of C interfaces to the low-level WASI syscalls. | ||
|
||
This is largely based on [CloudABI], [cloudlibc], and [libpreopen], however we | ||
use just the low-level syscall wrappers rather than all of cloudlibc and | ||
libpreopen, and we have several customizations for use in a WebAssembly sysroot. | ||
This implementation is partially derived from the "bottom half" of [cloudlibc], | ||
revision 8835639f27fc42d32096d59d294a0bbb857dc368. | ||
|
||
[CloudABI]: https://github.com/NuxiNL/cloudabi | ||
[cloudlibc]: https://github.com/NuxiNL/cloudlibc | ||
[libpreopen]: https://github.com/musec/libpreopen | ||
|
||
The upstream repositories and versions used here are: | ||
|
||
cloudlibc - https://github.com/NuxiNL/cloudlibc 8835639f27fc42d32096d59d294a0bbb857dc368 | ||
libpreopen - https://github.com/musec/libpreopen b29e9287cc75a7db7291ce3eb468a3d2bad8ceb1 | ||
This implementation includes preopen functionality, which emulates POSIX APIs | ||
accepting absolute paths by translating them into pre-opened directory handles | ||
and relative paths that can be opened with `openat`. This technique is inspired | ||
by [libpreopen], however the implementation here is designed to be built into | ||
libc rather than to be a layer on top of libc. | ||
|
||
Whole files which are unused are omitted. Changes to upstream code are wrapped | ||
in preprocessor directives controlled by the macro `__wasilibc_unmodified_upstream`, | ||
except that CloudABI names have also been renamed to WASI names without annotations. | ||
[libpreopen]: https://github.com/musec/libpreopen | ||
|
||
WASI libc currently depends on the basics and dlmalloc components of reference-sysroot. | ||
The WASI libc "bottom half" depends on the basics and dlmalloc components of | ||
wasi-libc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.