fix(libkernel): resolve kern.proc.proc by name #14591
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14591"
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 ahmadmuj on 2026-11-01T16:11:46Z.
What
#13532 added
sysctl{1, 14, 8} (kern.proc.proc), but the name paths were never wired up, sosysctlbyname("kern.proc.proc")andsysctlnametomib("kern.proc.proc")still return -1 withENOENT.kern.proc.pathnamealready has both.This maps the name to {1, 14, 8} in both places, the way FreeBSD 11.4 does it:
kern_proc.cregisters the node asprocunderkern.proc, andsysctlbynameis just the name lookup plus a numericsysctl. So the name reaches the existing handler with 3 elements, whichsysctl_kern_procaccepts forKERN_PROC_PROC.No new behaviour in the handler. The open gaps in the
kern.proc.procdebt entry (one process, record size, size estimate) apply the same way to the name, so the entry stays as is. I don't know of a title that asks for this by name; it just closes the name/number mismatch #13532 left.Tested
Ubuntu 24.04 on WSL2, GCC 13.3, Release build.
guest_system_configuration: fails onmainwith the new checks (aborts at the named size query, and at thesysctlnametomibtable row with only thesysctlbynamechange), passes with the fix, 3 runs.ENOMEMon a 100-byte buffer (length kept),EPERMon a write, and thesysctlnametomibMIB {1, 14, 8} with size 3.public_headers: pass.python3 tools/check_conventions.py --base origin/main: pass.Overlap:
tools/pr_overlap.py --branchreports no overlap with the 1,790 open PRs. A paginatedpulls/filesscan lists both files in 14 old PRs (#9588, #9688, #10113, #10226, #10229, #10247, #10317, #10349, #10351, #10469, #10492, #12053, #12299, #12598), but that's main's history showing through their old base: at each head both files have the same blob as at its merge base with main, so none of them changessysctlbyname,sysctlnametomib,CheckProcessListSysctlorCheckNameToMib.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-01T16:15:34Z.
Review: APPROVED
Reviewed — looks good
The name lookup maps to the existing
{1, 14, 8}handler, and the added tests cover named/numeric equivalence plus the relevant size, short-buffer, and write cases.What I ran
Reviewed exact head
00f69414ba3401fa71c394f733d86715fd7334bfagainst PR base/currentmainf2d874c1fdccf781c0fa5d86619bb5dd8894b958; the merge preview completed cleanly. Environment: Debian GNU/Linux 12, Python 3.11.2; no build or compiler run.Results
main.GuestSystemConfiguration.cppis registered by the libkernel CMake file.procunderkern.procas MIB value 8; the existing AnyPS5 handler accepts{1, 14, 8}.Unedited selected command output
git diff --check:Conventions:
Merge preview:
Hosted checks:
The precheck reported these unavailable helper scripts in the detached PR snapshot:
Sources
kern.proc.procregistrationsysctlbynamedispatch through name-to-MIB lookupNot verified
I did not build or run CTest locally, and hosted checks were pending. No console or title behavior was tested.