feat(libkernel): add chroot and clock_settime with FreeBSD argument checks #4890
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4890"
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 nabilfp on 2026-10-13T02:05:28Z.
What
Adds
chroot(AKknh8Cx-V8, libkernel_sys) andclock_settime(d7nUj1LOdDU, libkernel), carried from @screamm's branchscreamm:feat/libkernel-ps5mc-setfor #3632, keeping the commits as offered. The branch's other two commits (getpriority,chflags) are carried by open PRs #4374 and #4379, so this PR takes only the remaining two.chroot(path)follows FreeBSD 11.4sys_chroot/change_dirup to the lookup:EFAULTfor a null path,ENOENTfor an empty or missing one,ENOTDIRfor a path that is not a directory or passes through a file. Any directory that is found throws, naming it, because the guest resolver's root is fixed and the mount aliases (/app0,/savedata0) are host paths that do not move with it. Porpoise (PPSA99764) imports it.clock_settime(clock, ts)follows FreeBSD 11.4kern_clock_settimefor a root caller:EFAULTfor a null time,EINVALfor any clock butCLOCK_REALTIME, a negativetv_secor atv_nsecoutside 0 to 999999999. A validCLOCK_REALTIMErequest throws, naming the requested time, since the host clock is never set and no guest clock offset is kept. PS5MC (PPSA99420) imports it.Both NIDs were confirmed with
tools/nid_names.py(AKknh8Cx-V8→chroot,d7nUj1LOdDU→clock_settime). Debt entries were placed in the per-library filesdocs/dev/debt/libkernel_sys.mdanddocs/dev/debt/libkernel.md.Tested
Not built or run here: this host has no SDL2 submodule and no audio/X11 development files (no password for
sudo), so CMake configure fails before the libraries can be built.g++ -std=c++20 -fsyntax-onlypasses for all four changed files, andpython3 tools/check_conventions.py --base mainpasses. The behaviour and the tests inguest_kernel_sysandguest_freebsd_clocksare the ones tested on Windows by @screamm on the source branch, as described in #3632.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T02:20:28Z.
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.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL162-163docs/dev/debt/libkernel.mdL163docs/dev/debt/libkernel.mdL162-163core/libs/prx/libkernel_sys/Export.cppL40Imported from boykopovar/AnyPS5. Originally posted by nabilfp on 2026-10-13T02:37:29Z.
Closing this carry to stay within the one-open-PR intake limit while I open an original fix. The work itself is correct and free for anyone to carry:
chroot(commit643f4cbdd, tests + debt entry) andclock_settime(commit53485d5a5, tests + debt entry) onnabilfp:feat/libkernel-chroot-clock-settime.Pull request closed