-
Notifications
You must be signed in to change notification settings - Fork 73
add all wasi hostcalls used by Go SDK #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
johnlanni
wants to merge
1
commit into
proxy-wasm:main
Choose a base branch
from
johnlanni:add-all-wasi-hostcalls
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
|
@@ -133,6 +133,7 @@ Word wasi_unstable_path_open(Word fd, Word dir_flags, Word path, Word path_len, | |
int64_t fs_rights_base, int64_t fg_rights_inheriting, Word fd_flags, | ||
Word nwritten_ptr); | ||
Word wasi_unstable_fd_prestat_get(Word fd, Word buf_ptr); | ||
Word wasi_unstable_fd_filestat_get(Word fd, Word buf_ptr); | ||
Word wasi_unstable_fd_prestat_dir_name(Word fd, Word path_ptr, Word path_len); | ||
Word wasi_unstable_fd_write(Word fd, Word iovs, Word iovs_len, Word nwritten_ptr); | ||
Word wasi_unstable_fd_read(Word, Word, Word, Word); | ||
|
@@ -148,9 +149,35 @@ Word wasi_unstable_sched_yield(); | |
Word wasi_unstable_poll_oneoff(Word in, Word out, Word nsubscriptions, Word nevents); | ||
void wasi_unstable_proc_exit(Word); | ||
Word wasi_unstable_clock_time_get(Word, uint64_t, Word); | ||
Word wasi_unstable_clock_res_get(Word, Word); | ||
Word wasi_unstable_fd_advise(Word, uint64_t, uint64_t, Word); | ||
Word wasi_unstable_fd_allocate(Word, uint64_t, uint64_t); | ||
Word wasi_unstable_fd_datasync(Word); | ||
Word wasi_unstable_fd_fdstat_set_rights(Word, uint64_t, uint64_t); | ||
Word wasi_unstable_fd_filestat_set_size(Word, uint64_t); | ||
Word wasi_unstable_fd_filestat_set_times(Word, uint64_t, uint64_t, Word); | ||
Word wasi_unstable_fd_pread(Word, Word, Word, uint64_t, Word); | ||
Word wasi_unstable_fd_pwrite(Word, Word, Word, uint64_t, Word); | ||
Word wasi_unstable_fd_readdir(Word, Word, Word, uint64_t, Word); | ||
Word wasi_unstable_fd_renumber(Word, Word); | ||
Word wasi_unstable_fd_sync(Word); | ||
Word wasi_unstable_fd_tell(Word, Word); | ||
Word wasi_unstable_path_create_directory(Word, Word, Word); | ||
Word wasi_unstable_path_filestat_set_times(Word, Word, Word, Word, uint64_t, uint64_t, Word); | ||
Word wasi_unstable_path_link(Word, Word, Word, Word, Word, Word); | ||
Word wasi_unstable_path_readlink(Word, Word, Word, Word, Word, Word); | ||
Word wasi_unstable_path_remove_directory(Word, Word, Word); | ||
Word wasi_unstable_path_rename(Word, Word, Word, Word, Word); | ||
Word wasi_unstable_path_symlink(Word, Word, Word, Word); | ||
Word wasi_unstable_path_unlink_file(Word, Word, Word); | ||
Word wasi_unstable_sock_accept(Word, Word, Word); | ||
Word wasi_unstable_sock_recv(Word, Word, Word, Word, Word, Word); | ||
Word wasi_unstable_sock_send(Word, Word, Word, Word, Word); | ||
Word wasi_unstable_sock_shutdown(Word, Word); | ||
Word wasi_unstable_random_get(Word, Word); | ||
Word pthread_equal(Word left, Word right); | ||
void emscripten_notify_memory_growth(Word); | ||
Word wasi_unstable_path_filestat_get(Word fd, Word flags, Word path, Word path_len, Word buf); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: this should be grouped with other |
||
|
||
// Support for embedders, not exported to Wasm. | ||
|
||
|
@@ -174,9 +201,15 @@ void emscripten_notify_memory_growth(Word); | |
|
||
#define FOR_ALL_WASI_FUNCTIONS(_f) \ | ||
_f(fd_write) _f(fd_read) _f(fd_seek) _f(fd_close) _f(fd_fdstat_get) _f(fd_fdstat_set_flags) \ | ||
_f(environ_get) _f(environ_sizes_get) _f(args_get) _f(args_sizes_get) _f(clock_time_get) \ | ||
_f(random_get) _f(sched_yield) _f(poll_oneoff) _f(proc_exit) _f(path_open) \ | ||
_f(fd_prestat_get) _f(fd_prestat_dir_name) | ||
_f(fd_fdstat_set_rights) _f(environ_get) _f(environ_sizes_get) _f(args_get) _f(args_sizes_get) \ | ||
_f(clock_time_get) _f(clock_res_get) _f(fd_advise) _f(fd_allocate) _f(fd_datasync) \ | ||
_f(fd_filestat_set_size) _f(fd_filestat_set_times) _f(fd_pread) _f(fd_pwrite) \ | ||
_f(fd_readdir) _f(fd_renumber) _f(fd_sync) _f(fd_tell) _f(path_create_directory) \ | ||
_f(path_filestat_set_times) _f(path_link) _f(path_readlink) _f(path_remove_directory) \ | ||
_f(path_rename) _f(path_symlink) _f(path_unlink_file) _f(sock_accept) \ | ||
_f(sock_recv) _f(sock_send) _f(sock_shutdown) _f(random_get) _f(sched_yield) \ | ||
_f(poll_oneoff) _f(proc_exit) _f(path_open) _f(fd_prestat_get) \ | ||
_f(fd_prestat_dir_name) _f(path_filestat_get) _f(fd_filestat_get) | ||
|
||
// Helpers to generate a stub to pass to VM, in place of a restricted proxy-wasm capability. | ||
#define _CREATE_PROXY_WASM_STUB(_fn) \ | ||
|
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably, those socket functions are not "randomly" imported by the Go runtime, and if we add stubs for them, then we're replacing load time failure with a runtime failure.
There is a difference between existing functions (bare minimum required by runtimes to load targets compiled to a WASI architecture) vs adding everything without implementing it.
Why are those needed?