feat(libkernel): add setitimer on the alarm timer #3800
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3800"
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 YossiYad on 2026-10-11T16:48:23Z.
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 #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 repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T16:48:54Z.
Progress report (
0142215→5e1ffc2)➖ System libraries: 86.46% (+0.0%, +1 implemented functions)
✅ 1 implemented
setitimer_nid_postfixImported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-11T22:20:39Z.
Rebased onto current
main(33067ca0c).maingainedgetitimerin1fc9b4d93, which declares the sameGuestItimervalinSignals.cpp; the carried commit now keeps the one copy frommain, with no other change to it.One follow-up commit:
getitimeronmainalways reported a zeroit_interval, which was true whilealarmwas the only writer. Withsetitimerarming a periodicITIMER_REAL, it read back as one-shot. ec642b222 reports the interval and extendsguest_itimerto read the timer throughgetitimerafter re-arming; the new check fails without the fix (getitimer did not report the setitimer interval).Linux, GCC, Release: full ctest 901/901 before the follow-up; after it
guest_itimer,guest_getitimer,guest_signalsandguest_signal_setspass.tools/check_conventions.py --base upstream/mainpasses.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:17:24Z.
Same as #3781: conflicts with main in
docs/dev/TechnicalDebt.md; please rebase.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T23:56:59Z.
I independently rebuilt the carried implementation on current
main(bca7a29d) with GCC 12.2, Release/Ninja, andBUILD_TESTING=ON. Theguest_itimerandguest_signalsCTest cases passed (2/2), including thegetitimerinterval regression check, andtools/check_conventions.py --base upstream/mainpassed. This validates the rebase integration locally; it does not change the PR branch or replace its CI.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T08:33:39Z.
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.
main)core/libs/prx/libkernel/System/src/Signals.cppL92, L101, L107, L113, L126, L128, L138-142, L183core/libs/tests/GuestItimer.cppsetitimer_nid_postfixcore/libs/tests/GuestItimer.cppImported from boykopovar/AnyPS5. Originally posted by ArekatlaNishanthchowdary on 2026-10-12T19:25:04Z.
Rebase handoff: the two commits rebased onto current
main, authorship unchanged:ArekatlaNishanthchowdary:carry/libkernel-setitimer-rebased(638bc3df3, based53960612).The only conflict was
docs/dev/TechnicalDebt.md, whichmainsplit into one file per library in342a8c459. Thesetitimerentry is now the last line ofdocs/dev/debt/libkernel.md, with its link changed to../../../core/...;TechnicalDebt.mdis left as onmain. The code applied without conflict.Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release: full build passes, full
ctest996/996 passed,tools/check_conventions.py --base origin/mainpasses. Linux not run.To pick it up:
git fetch https://github.com/ArekatlaNishanthchowdary/AnyPS5 carry/libkernel-setitimer-rebased && git reset --hard FETCH_HEAD, then force-push.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:11:09Z.
Rebased onto current
main; the only conflict was the TechnicalDebt entry, now indocs/dev/debt/libkernel.md(author and code unchanged). Checked on Linux: build,guest_itimer,guest_signalsandguest_signal_setspass. Merging once CI is green. #4382 carries the same commit and becomes redundant.