Skip to content

Remove __syscall_pause#27044

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:remove_pause_syscall
Jun 2, 2026
Merged

Remove __syscall_pause#27044
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:remove_pause_syscall

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Jun 1, 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

@sbc100 sbc100 requested a review from kleisauke June 1, 2026 19:42
@sbc100 sbc100 force-pushed the remove_pause_syscall branch from ccbcf3e to 179bbfb Compare June 1, 2026 20:10
@sbc100 sbc100 requested a review from kripken June 1, 2026 20:24
Comment thread test/unistd/misc.out
@sbc100 sbc100 force-pushed the remove_pause_syscall branch from 179bbfb to 34caee0 Compare June 1, 2026 21:25
@sbc100 sbc100 requested a review from kripken June 1, 2026 21:26
@sbc100 sbc100 force-pushed the remove_pause_syscall branch from 34caee0 to 1e561db Compare June 1, 2026 21:27
@sbc100 sbc100 force-pushed the remove_pause_syscall branch from 57be8dc to 566782a Compare June 1, 2026 23:48
@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Jun 1, 2026

I simplified this PR again so that pause now returns 0.

I explained why I think that is OK in the PR description and we can followup with #27049 if we decide we prefer these functions to fail rather than lie about blocking.

@sbc100 sbc100 enabled auto-merge (squash) June 1, 2026 23:56
@sbc100 sbc100 merged commit f6a4ca2 into emscripten-core:main Jun 2, 2026
39 checks passed
@sbc100 sbc100 deleted the remove_pause_syscall branch June 2, 2026 00:42
@kripken
Copy link
Copy Markdown
Member

kripken commented Jun 2, 2026

I'm not opposed to this change, but let's mention it in the changelog?

@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Jun 2, 2026

What do you think about updating poll in #27049 to return non-zero when it needs to block but cannot.

If we land #27049 it would have the side effect of restoring this pause() behaviour?

@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Jun 2, 2026

Let me phrase this as choice of two options that I'd like us to choose between for the next release:

  1. pause() syscall goes from EINTR to silent success. poll() continues to return silent success when it should really block.
  2. Change poll() to that it no longer silently return success and instead returns EINTR when it cannot block but needs to. If we do this then the behaviour of pause() will continue to be EINTR (since pause if uses poll to block).

@kripken
Copy link
Copy Markdown
Member

kripken commented Jun 2, 2026

I feel I don't have enough of a sense of how user code uses this syscall to pick between them. So I don't feel strongly.

But if we change a syscall or libc function, I think it's worth mentioning that breaking change.

@sbc100
Copy link
Copy Markdown
Collaborator Author

sbc100 commented Jun 2, 2026

I'm thinking of going with #27049 which will effecitivly revert the user-visible change in this PR, but I will update the ChangeLog not and then remove if I land #27049

sbc100 added a commit that referenced this pull request Jun 3, 2026
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