fix(libkernel): fail sigprocmask with EINVAL for an unknown how #7365
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7365"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T02:38:41Z.
What
sigprocmaskand_sigprocmaskthrewstd::invalid_argument("_sigprocmask: invalid how")whenhowwas notSIG_BLOCK(1),SIG_UNBLOCK(2) orSIG_SETMASK(3), which ends the title. FreeBSD'ssys_sigprocmaskhandles it differently:EINVAL;howwhensetis null.pthread_sigmaskhere already returnsEINVALthis way._sigprocmasknow checkshowfirst, before it writes the previous mask, and the unreachabledefaultthrow is gone.Tested
Ubuntu 24.04, GCC 13.3, Release.
guest_signal_setsgainsCheckInvalidHow. Forhow0, 4, -1 and 1000 with a set, both_sigprocmaskandsigprocmaskmust return -1 with errno 22, leave the previous-mask buffer untouched and leave the blocked mask unchanged. With a null set, the call must return 0 and report the current mask.mainb39d90bf14the test aborts on the first call (uncaughtstd::invalid_argument).guest_signals,guest_sigtimedwait,guest_itimer*,guest_user_context*,guest_sigaltstack.tools/check_conventions.py --base upstream/mainpasses.#3986 rewrites this switch for per-thread masks and keeps the throw. Whichever lands second needs a small rebase there.
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T03:02:37Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel/System/src/Signals.cppcore/libs/tests/GuestSignalSets.cppcore/libs/prx/libkernel/System/src/Signals.cpp