libkernel: sysctl throws for kern.proc.pathname, machdep.cacheline_size and hw.physmem (XPSemu, PS5MC); fix branch ready #3722
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 screamm on 2026-10-11T15:59:59Z.
libkernel's
sysctl/sysctlbynameanswer onlyhw.ncpuandkern.rng_pseudoand throw for every other name. XPSemu (PPSA97358) callssysctlbyname("machdep.cacheline_size")from a constructor beforemainandsysctl({CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1})inqemu_init; PS5MC (PPSA99420) also queriessysctl. Both tolerate a failure but need a return rather than the throw (predicted lines:what(): sysctlbyname_nid_postfix: unsupported name machdep.cacheline_size).Fix branch ready:
screamm:feat/libkernel-sysctl-names(fd017757, one commit onmaina11c8f7f). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. It touches the end ofsysctlbynamelike the open #2902 (kern.sdk_version) does; the resolution is to keep both blocks before the final throw.kern.proc.pathname(MIB{1,14,12,pid}):/app0/eboot.binfor pid -1 and the caller's own pid,ESRCHfor any other pid,EINVALfor a MIB without exactly one pid argument or for the by-name form, following FreeBSD 11.4sys/kern/kern_proc.csysctl_kern_proc_pathname(8c639945); the path is relative to the process root asvn_fullpathbuilds it, which for a title is its sandbox (ps5-payload-devsamples/list_files), consistent with__prognameand the/app0mount model. Console confirmation of the exact string is recorded as open.machdep.cacheline_size:ENOENT, because no FreeBSD amd64/x86 code defines that name (it exists only undersys/powerpc); XPSemu then keeps its own fallback.hw.physmem(name and MIB{6,5}): the same physical memorysysconf(_SC_PHYS_PAGES)already reports, so the two stay consistent (FreeBSD derives both fromphysmem,kern_mib.c).sysctl_root: size query for a nulloldp, truncated copy withENOMEMfor a short buffer,EPERMfornewpon these read-only names before the handler runs. Unknown names still throw, as before.guest_system_configurationcovers each name over the size query, exact copy, short buffer,ESRCH,EPERM, theEINVALcases and the untouched caller buffer forENOENT.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_system_configuration3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"ran under heavy host load (six other builds): the failures beyond the knownwindows_exceptions(#3411, fixed by #3415),guest_kernel_sys(#3510),guest_filesystem(#3518) and theguest_ampr_markersflake (#3371) were timeouts ofguest_sce_net,guest_pthread_startandguest_pthread_rwlock, which pass when rerun serially. Withmain'sSystemConfiguration.cppthe extended test fails;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).