Repository navigation
feat(libkernel): implement getpriority for the guest process - #4374
Conversation
|
Windows test: head AI-assisted (Claude Code). |
|
Rebase handoff — rebased onto current One conflict in Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up: Head is |
46614e2 to
94ba790
Compare
8d212f2 to
8c87cae
Compare
|
Windows validation with title evidence (Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, |
getpriority reuses the existing errnoNoSuchProcess/errnoInvalidArgument constants instead of a duplicate guestNoProcess; the test drops its second __error_nid_postfix declaration.
|
Title run with this PR: Windows 11, MinGW GCC 15.2.0 (WinLibs), Release. Built on
AI-assisted (Claude Code). |
66cd938 to
b515899
Compare
PS5MC (PPSA99420, Kodi 22) imports getpriority (miQ1wVwSexE) from libkernel.prx, one reference, next to chflags in its import order. Predicted stop once the imports ahead of it are covered (not a run): FAIL: unresolved ELF import miQ1wVwSexE from libkernel.prx The NID is computed with tools/nid_names.py and matches aerolib. Follows FreeBSD 11.4 sys/kern/kern_resource.c sys_getpriority (8c639945a44588f6cfdddfb057bb5aad88735da0) for the only guest process, taken to run at nice 0 and to lead its own process group (as kill and setsid already assume): PRIO_PROCESS and PRIO_PGRP with 0 or its pid, and PRIO_USER with 0 or its uid 0, return 0; other ids give ESRCH and an unknown which gives EINVAL. getpriority is a bare system call in FreeBSD's libc (lib/libc/sys/Symbol.map), so errno is left unchanged on success. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> (cherry picked from commit 6326224)
b515899 to
1ba0a81
Compare
What
Carries the
getpriorityimplementation from #3632, preserving the original commit author. For the single guest process, it follows FreeBSD 11.4:PRIO_PROCESSandPRIO_PGRPfor id 0 or the current pid, andPRIO_USERfor id 0 or the guest uid, return nice 0. UnknownwhichreturnsEINVAL; other ids returnESRCH. Successful calls leave guesterrnounchanged. The console nice value remains unmeasured and is documented indocs/dev/debt/libkernel.md.PPSA99420 reaches this import after
chflagsis resolved by #4379 (issue #1578). This PR covers onlygetpriority; the other exports from #3632 remain separate work.Tested
guest_sched_priority_tests; CTest passed 1/1, and conventions and diff checks passed.Checklist
main; no other open PR implements the same functiongetpriority