Repository navigation
Conversation
The public SDK's libkernel, libkernel_sys and libkernel_web stub tables declare _sigintr, the sigset_t that FreeBSD's libc shares between signal and siginterrupt, and no built library provided it (boykopovar#8846). libkernel now exports the 16-byte object, zero at start, and signal records a handler with SA_RESTART unless its signal is in the set, as lib/libc/gen/signal.c does. siginterrupt, which fills the set, is a libSceLibcInternal export; libc does not link libkernel and cannot reach the dispositions, so it stays out and a debt entry for signal says so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…gisters siginterrupt is a libSceLibcInternal export (the public SDK's stub table has it there, not in the kernel tables) and FreeBSD 11.4's lib/libc/gen/siginterrupt.c reads the signal's disposition, sets or clears the signal's bit in _sigintr and SA_RESTART, and installs the disposition again. libc cannot call libkernel, so, as the pthread hooks do, libc keeps a registered sigaction and the address of the _sigintr set, and libkernel registers both from a static initializer when it loads. A call before that throws; the set is written without libkernel's registration lock, as FreeBSD's libc does. Builds on boykopovar#8866, which adds the set. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
Manual review of the overlap warning: #6565 appends a libc debt entry at the end of |
What
libc.prxexportssiginterrupt(TsrS8nGDQok, a libSceLibcInternal export in the public SDK's stub table) and runs FreeBSD 11.4'slib/libc/gen/siginterrupt.csequence: read the signal's disposition withsigaction, set or clear the signal's bit in_sigintrandSA_RESTARTin the flags, install the disposition again.EINVALfor a signal outside 1 to 128 comes from the firstsigaction, as there.libc cannot call libkernel (libkernel links libc), so this follows the pattern the pthread hooks already use: libc keeps a registered
sigactionand the address of the_sigintrset (RegisterSigaction_nid_no_patchinGeneral.hpp), and libkernel registers both from a static initializer inSignals.cppwhen it loads, asRegisterPthreadOnLoaddoes inThread.cpp. A call before that registration throws. The set is written outside libkernel's registration lock, as FreeBSD's libc writes it without one; the libc debt entry says so, and the libkernelsignalentry from #8866 now points here.Depends on #8866, which adds the
_sigintrexport and makessignalhonour it; this branch is stacked on it and the diff shows both until it merges.Tested
Windows 11, MinGW GCC 15.2.0, Release,
BUILD_TESTING=ON, onmain05f9995 plus #8866:guest_signals, extended:siginterrupt(30, 1)sets bit 29 and clearsSA_RESTARTon the installed handler, a followingsignal(30)registers withoutSA_RESTART,siginterrupt(30, 0)clears the bit and restoresSA_RESTART; the same on signal 128 (bit 127) with the default disposition; 0, -1 and 129 fail withEINVALand leave the set alone.guest_signalspasses (1 of 1).siginterruptthrows; restored, it passes. It exits with0xc0000409andwhat(): siginterrupt: libkernel has not registered sigactionon the reverted build, and passes again on the restored one.tools/import_audit.pyon a one-line registry importingTsrS8nGDQokfromlibSceLibcInternal.prxagainst the built libraries:implemented 1, absent 0; the tool exits 1 only to note that--libshas no file namedlibSceLibcInternal.prx, whichlibc.prxserves.python tools/check_conventions.py --base origin/main --head HEADpasses.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