feat(libkernel): add clock_settime with FreeBSD argument checks #5183
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5183"
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 p3n1cillin on 2026-10-13T14:09:47Z.
What
Carries @nabilfp's
clock_settimecommit fromnabilfp:feat/libkernel-chroot-clock-settime(53485d5a5, author kept), which they closed #4890 to free their PR slot and offered for anyone to carry. It follows FreeBSD 11.4sys_clock_settime/kern_clock_settimefor a privileged caller:EFAULTfor a null time, andEINVALfor any clock other thanCLOCK_REALTIMEand for a negativetv_secor atv_nsecoutside 0 to 999999999. A validCLOCK_REALTIMErequest throws, since the host clock must not be set. The details are in the commit message and the debt entry.Title evidence: PS5MC (PPSA99420, Kodi 22, catalog release) imports
clock_settime(d7nUj1LOdDU). On currentmainwith the open #4379 (chflags), #4374 (getpriority) and #4383 (sigpending),tools/import_audit.pylists it as the title's only absent import, so the loader stops on it:With this commit too, PS5MC loads and runs into Kodi's start-up, which then needs #5184, #5185 and #5186.
Tested
main3faa9cb40with #4379, #4374, #4383 and #5184, #5185 and #5186 (vm.overcommit,_SC_CLK_TCK,FIOCLEX): it loads, starts Python, finds its add-ons and the Estuary skin, creates its GUI on theps5windowing system, and runs for the whole 90 s run. Without this commit it does not load.guest_freebsd_clocks(from the commit) and all 125 libkernel tests pass on Windows;python tools/check_conventions.py --base origin/mainpasses. The commit applies to currentmainwithout changes.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-13T14:11:15Z.
Progress report (
91ed4ce→ae9978a)➖ System libraries: 88.04% (+0.0%, +1 implemented functions)
✅ 1 implemented
clock_settime_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:15:26Z.
Checked against FreeBSD 11.4
sys_clock_settime/kern_clock_settime: EFAULT for a null time, EINVAL for non-CLOCK_REALTIME, negativetv_secor out-of-rangetv_nsec, all match; a valid request throws and the debt entry documents it. Built and ran libs + libkernel ctest (146/146),guest_freebsd_clocksfails to link without the change and passes with it. Merging once the full build is green.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T14:19:57Z.
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)docs/dev/debt/libkernel.mdL168docs/dev/debt/libkernel.mdL168docs/dev/debt/libkernel.mdL168docs/dev/debt/libkernel.mdL168core/libs/tests/GuestFreebsdClocks.cppL6, L207, L210-211Imported from boykopovar/AnyPS5. Originally posted by p3n1cillin on 2026-10-13T14:34:43Z.
Linux run: Ubuntu in WSL2, GCC 15.2.0, Ninja Release,
BUILD_TESTING=ON, full build of a local test head838d4fd85. That head ismain3faa9cb40with this PR, my other open libkernel PRs (#5013, #5061, #5078, #5098, #5183–#5187, #5191) and the open PRs the catalog titles need (#4377, #4379, #4374, #4383, #3798, #4467, #4863, #4105). All 123 libkernel and 69 libc tests pass, includingguest_system_configuration,guest_getrlimit,guest_kernel_fcntl,guest_freebsd_clocks,guest_kernel_sysandguest_filesystem. Not built alone on Linux; no title run on Linux.