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
Change fork() and system() to not return EAGAIN #7005
Conversation
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.
I'll look at the test failures as soon as I can. |
Thanks @haukex! The change looks good. Test failures look like test outputs that need updating for the new error code. Should be easy, let me know if you run into a problem. Also, please add yourself to AUTHORS. |
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 see also 97a091b#diff-be537b9f6dffd5af65894f62ef7416cfR27 comes from The Open Group's UNIX Specification at http://pubs.opengroup.org/onlinepubs/7908799/xsh/fork.html which has the wording
and
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/ |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
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 :-)