Update poll/select/pause to return -EINTR when they cannot block#27049
Open
sbc100 wants to merge 1 commit into
Open
Update poll/select/pause to return -EINTR when they cannot block#27049sbc100 wants to merge 1 commit into
poll/select/pause to return -EINTR when they cannot block#27049sbc100 wants to merge 1 commit into
Conversation
sbc100
added a commit
that referenced
this pull request
Jun 2, 2026
We don't support this syscall and musl already has a fall back based on `poll`/`ppoll`. Note that the return value for `pause()` now changes to zero (from ENOSYS), because it is now based in `poll` internally and currently our `__syscall_poll` implementation returns zero when it would otherwise need to block. I have another change out the potentially change that (#27049) but we can consider that separately to this change. See #27036 and #27038
Collaborator
Author
|
Marking as draft since I'm not sure we really need this change. |
poll/select/pause to return -EINTR when they cannot block
Previously we were just returning zero in this case (i.e. we were pretending that timeout expired). This required a fix to select() to use __syscall_ret so that it correctly sets errno on failure. Update test_sockets_partial to handle EINTR by returning early. Add a test case to test_pipe_select to verify that select() returns -1 with EINTR on the main thread when no FDs are ready.
Collaborator
Author
|
@hoodmane do you think this change will effect you? Do you agree its reasonable thing to do? i.e. when we cannot actually block there is not really a good return code here but most caller of these function should be handling EINTR I would hope? |
Collaborator
|
I'll try building Python against this commit and see what happens with the test suite. |
Collaborator
|
Okay I ran the Python test suite on this commit and I don't think it breaks anything. |
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.
Previously we were just returning zero in this case (i.e. we were pretending that timeout expired).
This change also restores the old behaviour of the
pause()syscall prior to #27044 (because pause is implemented usingpoll).This required a fix to
select()which was not correctly using__syscall_retto set theerrnovalu failure.Update
test_sockets_partialto handleEINTRby returning early.Add a test case to
test_pipe_selectto verify thatselect()returns -1 withEINTRon the main thread when no FDs are ready.Split out from #27044