Repository navigation
feat(libkernel): implement sigsuspend on the pending-signal set - #5666
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
One mask-width gap: GuestSignalSet has four 32-bit words and MaxSignal is 128, but sigsuspend copies only set->bits[0] into the 32-bit blockedMask; SignalBlocked also returns false for every signal above 32. A caught/pending signal represented in bits 1–3 therefore remains deliverable during sigsuspend even when the supplied mask includes it. The existing _sigprocmask shares this state-width limitation, so fixing the new entry point fully may require widening the shared mask representation and exercising a high-word signal in the regression test. The debt entry describes pending/wait support for all 128 signals.
|
Thanks for the review — you're right about the width gap. I kept the 32-signal mask on purpose: |
|
Follow-up note from #5669: that PR keeps the scalar low-word |
|
Noted, thanks — and thanks for keeping #5669 source-compatible. Plan on my side: once #5669 lands I'll rebase this branch, extend the swap/restore to all four mask words, and add a high-word signal case to the test (the regression coverage you asked for in the first review). Until then this PR stays as-is against current |
Did that on Windows:
The wait itself looks right to me: the first check runs under the pending lock and
In case it's useful, I put a test on a branch on top of your head: pipe1os:test/sigsuspend-freebsd-checks ( AI-assisted. |
|
Did both. Null now throws std::invalid_argument, same as _sigprocmask for a bad argument. The wait loop is shared with pause, and the restore goes through _sigprocmask itself. The test covers the throw, a main-thread wake, and a sender wakeup, all on signal 30 so no host signal is involved. I looked at your branch but wrote the cases here to match this file. Left the mask width for #5669. |
8733e94 to
1ce5c2c
Compare
|
Checked |
What
Adds
sigsuspend(KZ-4qlqlpmo) to libkernel's signal model: swaps the process-wide blocked mask for its argument, waits aspausedoes for a pending signal that is not blocked and deliverable, restores the mask, delivers what the restore unblocked as_sigprocmaskdoes, and returns -1 withEINTR; a null set returns -1 withEFAULT. Extends thepause, sigwait, sigwaitinfodebt entry andguest_signal_tests(null set, plus a suspender/sender pair covering delivery on the suspender, mask restore andEINTR, mirroring the sender pattern ofguest_sigtimedwait_tests).Tested
No full build in this container (no submodules/toolchain for it). Verified: the new wait path compiled and ran natively against the real
Signals.cppTU 10/10 (swap, pending take under the new mask, handler delivery on the suspender, mask restore,EINTR); both touched TUs parse clean;python3 tools/check_conventions.pypasses. Full build andguest_signal_testsleft to CI / reviewer run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)FAIL: unresolved ELF import KZ-4qlqlpmo from libkernel.prx, 4th loader blocker after sysctlnametomib/fegetenv/mincore)