Repository navigation
feat(libkernel): add setitimer on the alarm timer - #3800
Conversation
2d9da88 to
ec642b2
Compare
|
Rebased onto current One follow-up commit: Linux, GCC, Release: full ctest 901/901 before the follow-up; after it |
|
Same as #3781: conflicts with main in |
|
I independently rebuilt the carried implementation on current |
|
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.
|
|
Rebase handoff: the two commits rebased onto current The only conflict was Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release: full build passes, full To pick it up: AI-assisted: yes (Claude Code). |
PS5MC (PPSA99420) imports setitimer (hPWDGx8ioXQ, aerolib) at registry index 472, after tcsetpgrp and before getitimer. Predicted stop: "FAIL: unresolved ELF import hPWDGx8ioXQ from libkernel.prx". setitimer follows FreeBSD 11.4 kern_time.c (8c639945) sys_setitimer and kern_setitimer: EINVAL for an unknown timer and for an itimerfix failure or more than INT32_MAX / 2 seconds; a zero value clears the interval and disarms; a null value reads the timer, EFAULT when the output is null too. ITIMER_REAL shares the alarm state, now with an interval that re-arms it as realitexpire does; alarm clears it, as FreeBSD's alarm.c does. Guest SIGALRM handlers are not run, so an expiry with a handler, or with SIGALRM blocked (signals are never left pending), throws naming the interval; SIG_IGN drops it and the default disposition exits with 142, as alarm already did. Intervals below 1 ms throw (itimerfix rounds them to tick / 16 and the console's hz is unknown). ITIMER_VIRTUAL and ITIMER_PROF throw when armed and read and disarm as zero. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
getitimer on main predates setitimer and always reported a zero it_interval, so a periodic ITIMER_REAL armed by setitimer read back as one-shot.
|
Rebased onto current |
ec642b2 to
5e1ffc2
Compare
What
Carries screamm's
screamm/AnyPS5:feat/libkernel-setitimercommit from #3735 unchanged onto currentmain, preserving its author:setitimeron the existingalarmtimer thread, after FreeBSD 11.4kern_time.candalarm.c:EINVALfor an unknown timer or a value/interval with a negative field,tv_usec >= 1000000or more thanINT32_MAX/2seconds; a null value reads the timer (EFAULTwhen the output is null too, after the timer check); a zero value disarms and returns the previous remaining time and interval; a non-zero value arms, re-armed byit_intervalon expiry.alarmnow clears the interval as FreeBSD's does.SIGALRMhandler or whileSIGALRMis blocked throws with the reason, asalarmalready does;ITIMER_VIRTUAL/ITIMER_PROFthrow when armed (no CPU time accounting) and read as zero; an interval below 1 ms throws (the kernel's tick rounding is not known). Recorded in TechnicalDebt.setitimer, as reported in libkernel: setitimer is absent (PS5MC); branch ready on the alarm timer, never reporting an undelivered signal #3735.getitimeris in the open #3572 and touches the sameSignals.cpp; whichever merges second should read the interval this PR stores (alarms.interval), since #3572 reports it as always 0.The library progress moves from 2903/3383 (85.81%) to 2904/3384 (85.82%). The total rises by one because
setitimerwas not exported before.Closes #3735.
Tested
Linux (Bazzite 44, GCC 16.2.1, Ninja, Release,
-DBUILD_TESTING=ON), based onmaina11c8f7f:libs, and fullctest: 825 pass, 8 skip, no failures (833 registered tests).guest_itimerandguest_signalspass 10 consecutive runs side by side. This is the first Linux run of the commit; the author reported Windows only.tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository