Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Change fork() and system() to not return EAGAIN #7005
The error code EAGAIN implies "try again later", but Emscripten's fork() will never succeed. Some C programs, when getting EAGAIN, will actually wait a few seconds and try again, sometimes many times. This patch changes fork() and system() to return ENOTSUP.
Any other error code is probably fine too, as long as it's not EAGAIN :-)
This change will cause the behavior to no longer conform to the Open POSIX Test Suite. The rationale for passing EAGAIN on these, as well as
comes from The Open Group's UNIX Specification at
which has the wording
The OPEN Posix Test Suite enforces that no other error conditions are reported except those that are listed, which is why the intent is to output
I am open to diverging from this behavior, and returning
See also occurrence of
(change all of those to ENOTSUP)
Hi, sorry for the delayed response, it turns out my laptop isn't powerful enough to efficiently run the test suite, so I'll have to go to another machine. I'll update the branch with the changes (including
I agree that the change doesn't exactly conform to POSIX, but I figured that ENOMEM wasn't really a good option either.
By the way, thank you both for all your work, it's allowed me to port Perl to WebAssembly! https://webperl.zero-g.net/