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.
Implement
open
/stat
/mkdir
/symlink
for standalone WASI mode #24246New 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
base: main
Are you sure you want to change the base?
Implement
open
/stat
/mkdir
/symlink
for standalone WASI mode #24246Changes from all commits
c606386
46b7fa4
16b1925
e12df0f
65bec88
ca3f795
52a4e03
53c309b
65e8c96
5303f12
95eab07
bd4a07c
73e982e
36e66d8
cc87f5d
67905b1
88650d8
f3a80bb
534223f
16d2ba7
eb35b6b
1ec092a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Please keep the copyright line from the original file, in addition to this text (which is good).
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.
Why
ifdef __wasm__
here? IIUC this code only compiles and run on wasmThere 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.
Why not just
preopens = realloc(preopen, new_capacity)
here?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.
use '
\0
' here for the terminator?This case looks like its trying to match
.
on its own and then return the empty string.. is that right?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.
Given that
register_preopened_fd
is going to store and use the prefix, why not pass owership? i.e. don't callfree()
here orstrdup
inregister_preopened_fd
?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.
Why not just
abort()
above instead of these goto + exit stuff?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.
Good question -- this seems to be a wasi-libc thing. The code in
__main_void
(also derived from wasi-libc) usesEX_OSERR
as well:emscripten/system/lib/standalone/__main_void.c
Line 36 in f3d9eb4