-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fork or posix_spawn return EAGAIN, should return ENOSYS #14124
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
Comments
Yes, it does look like we return EAGAIN for those: Lines 166 to 178 in b8724b8
Reading the manpage, I think I agree that ENOSYS would be more accurate (as EAGAIN means "hit the limit on the number of threads", or some other more temporary limit, and ENOSYS is a permanent limit). PR would be welcome! |
ijackson
added a commit
to ijackson/emscripten
that referenced
this issue
May 13, 2021
This is more correct. Trying again will not help. Fixes: emscripten-core#14124
sbc100
pushed a commit
that referenced
this issue
May 14, 2021
This is more correct. Trying again will not help. Fixes: #14124
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. I've come here to try to upstream a bug report about emscripten's behaviour which we experienced in the Rust CI. I hope this is appreciated.
tl;dr: I think, based on the behaviour of an emscripten test which runs in the Rust CI, and cursory inspection of
library.js
, that eitherfork
orposix_spawn
sets errno toEAGAIN
/EWOULDBLOCK
. IMO this is not correct. The correct response isENOSYS
.I had a look through the emscripten issues and MRs, and found #3819 where
posix_spawn
was stubbed out, and based on that I think the fix is to editlibrary.js
. I can prepare a drive-by MR for that if you like.More detailed information
As I say I am prompted by a failing test case in the Rust CI. The Rust code looks like this:
This failed:
rust-lang/rust#85032 (comment)
The error message includes this:
Evidently
Command:status()
gave an error withErrorKind::WouldBlock
. That is wrong. It should beUnsupported
. Rust has its own error number mapping. HereWouldBlock
came fromEAGAIN
orEWOULDBLOCK
.The code in the implementation of
Command
is not entirely trivial. I was working on it as part of rust-lang/rust#81858 so I'm reasonably familiar with it. I won't walk you through it, but basically, it first triesposix_spawn
and then falls back tofork
.Thanks for your attention. Let me know if you want me to make an MR to change this in emscripten.
The text was updated successfully, but these errors were encountered: