Skip to content

syscall: Accept O_NONBLOCK flag in pipe2#26501

Open
thiblahute wants to merge 1 commit intoemscripten-core:mainfrom
thiblahute:pipe2_nonblock
Open

syscall: Accept O_NONBLOCK flag in pipe2#26501
thiblahute wants to merge 1 commit intoemscripten-core:mainfrom
thiblahute:pipe2_nonblock

Conversation

@thiblahute
Copy link
Contributor

pipe2 only accepted O_CLOEXEC, rejecting O_NONBLOCK with ENOTSUP. Accept O_NONBLOCK and set it on the created pipe streams, it is a no-op in practice, but there is no reason to not allow it.

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the test for pipe2 to include this flag?

Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise! Thanks for working on this

@thiblahute
Copy link
Contributor Author

Added a test

@sbc100 sbc100 enabled auto-merge (squash) March 20, 2026 20:38
pipe2 only accepted O_CLOEXEC, rejecting O_NONBLOCK with ENOTSUP.
Accept O_NONBLOCK and set it on the created pipe streams.

This is needed by GLib's GWakeup which uses
pipe2(fds, O_CLOEXEC | O_NONBLOCK).
auto-merge was automatically disabled March 23, 2026 18:22

Head branch was pushed to by a user without write access

@sbc100
Copy link
Collaborator

sbc100 commented Mar 23, 2026

For the codesize test updates you will want to do emsdk install tot then ./tools/maint/rebaseline_tests.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants