Conversation
sbc100
approved these changes
Sep 30, 2019
| ex = e; | ||
| } | ||
| assert(ex instanceof FS.ErrnoError && ex.errno === 2); // ENOENT | ||
| assert(ex instanceof FS.ErrnoError && ex.errno === 44); // ENOENT |
Collaborator
There was a problem hiding this comment.
Why not use the macros here?
Member
Author
There was a problem hiding this comment.
Hmm, I guess the macros would work as this EM_ASM code, so the C preprocessor does run on it. May make sense as a followup, yeah.
| errno: 2 | ||
| X_OK(writeable): -1 | ||
| errno: 13 | ||
| errno: 2 |
Collaborator
There was a problem hiding this comment.
Seems like it would be better if these tests use strerror() to print errno? No need to make that part of this PR now.
Member
Author
There was a problem hiding this comment.
Makes sense, will leave that for a followup too.
belraquib
pushed a commit
to belraquib/emscripten
that referenced
this pull request
Dec 23, 2020
Redefine errno values to be consistent with wasi. This will let us avoid needing to convert the values back and forth as we use more wasi APIs (which I experiemented with and it adds 1K or so). This is an ABI change, which should not be noticeable from user code unless you use errno defines (like EAGAIN) and keep around binaries compiled with an older version that you link against. In that case, you should rebuild them. Fix NODEFS, which basically just routed the node errno code to ours, which only worked when the underlying system had codes similar to musl - which seems to have been the case on some linuxes. This does make NODEFS larger, as it uses the ERRNO lookup table now, I'll look into a way to avoid including it unnecessarily as a followup (would be a breaking change). Most of the changes in this PR are test changes, places where we printed raw errno codes.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Redefine errno values to be consistent with wasi. This will let us avoid
needing to convert the values back and forth as we use more wasi APIs (which
I experiemented with and it adds 1K or so).
This is an ABI change, which should not be noticeable from user code
unless you use errno defines (like EAGAIN) and keep around binaries
compiled with an older version that you link against. In that case, you
should rebuild them.
Fix NODEFS, which basically just routed the node errno code to ours, which
only worked when the underlying system had codes similar to musl - which seems
to have been the case on some linuxes. This does make NODEFS larger, as it
uses the ERRNO lookup table now, I'll look into a way to avoid including
it unnecessarily as a followup (would be a breaking change).
Most of the changes in this PR are test changes, places where we printed
raw errno codes.