feat(libkernel_sys): implement adjtime export #14257
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14257"
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 bipinkrish on 2026-11-01T04:30:46Z.
What
Implement
adjtimeunder the project's jailed-caller model from #11216.deltais read with checked guest access. An unreadable input returns-1with guestEFAULTbefore any privilege or output check.-1with guestEPERM. FreeBSD 11.4kern_adjtimechecksPRIV_ADJTIME, whichprison_priv_checkdenies to a jailed caller.oldDeltastays untouched on this failure.deltaqueries the pending correction, which is zero because no adjustment is accepted. An unwritable query output returnsEFAULT.The host clock is never adjusted. Console privileges and clock behavior remain unverified in the debt entry. Privileged unjailed callers are not modelled.
Land before #14299 and #14304. Their overlapping debt-inventory changes must be reconciled when rebased.
Tested
libkernel_sysCMake target andGuestKernelSysAdjtime.cppin an isolated harness. Existing guest libc/libkernel artifacts were reused.ctest --test-dir /tmp/anyps5-adjtime-jail-build -R '^guest_kernel_sys_adjtime$' --output-on-failurepassed outside the syscall-restricted sandbox.AdditionalExports.cppfails at its oldNotImplementedthrow. The revised production library passes.g++ -std=c++20 -Wall -Wextra -Werror -Icore/libs -fsyntax-only. Diff and convention/template checks passed.Previous-head Windows reports apply to
3fcc7f7580: WinLibs GCC 15.2.0, 3/3 runs, and MSYS2 GCC 16.1.0, 5/5 runs. These do not validate the new EPERM behavior.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 MarcZX10 on 2026-11-01T05:04:15Z.
Review: APPROVED
Reviewed — looks good
The implementation reports a zero pending adjustment for the supported null-delta query and keeps non-null clock changes explicitly unsupported instead of claiming success.
What I ran
Reviewed head
342117a322fdf8bbfa672050cde378e25965149d, against the PR base638ebe70f8656b03351ab853f117758a6d84bacb; I also checked a clean merge preview against currentmain3ab5a11d665ea59acec36de45c22c5358fea63d7. Environment: Debian 12 x86_64, GCC 12.2.0, Python 3.11.2. I did not build or run C++ tests locally.Results
core/libs/CMakeLists.txt. The test-quality heuristic's unregistered-test warning is a false positive.main.ctest -R 'guest_kernel_sys'passed 27/27; I did not independently run them.Unedited command output
Sources
Not verified
No local build, local CTest, or PS5-console run. The author-reported 27/27 tests were not independently reproduced. Windows CI had not completed; Linux and specialized hosted jobs were skipped when checked.