feat(libkernel_sys): implement pathconf #3611
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3611"
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 nicolasfalesy on 2026-10-11T14:13:36Z.
What
Carries @screamm's fix from #3502 (the author is under the open-PR limit). The commit is theirs, unchanged (d93d0e588), rebased onto current
main(68ab3859e) by @blawesom.Porpoise 2.7 (PPSA99764) stops at load on main:
FAIL: unresolved ELF import oc98+zOImus from libkernel_sys.prxoc98+zOImusispathconf(tools/nid_names.py, aerolib.csv at zecoxao/sce_symbols 2883963a). It is exported fromlibkernel_sysnext tolinkandreadlink.The lookup follows FreeBSD 11's
kern_pathconfandnamei(release/11.0.0, 671fb7df): links are followed, a path of 1024 bytes or more or a component over 255 fails withENAMETOOLONG, a missing path withENOENT. The values are the constants of FreeBSD 11's UFSufs_pathconf, whichvop_stdpathconfshares where both answer. Names whose UFS value depends on the mount, the kernel options or the page size, or on which UFS andvop_stdpathconfdisagree, throw; other names fail withEINVAL. The console's filesystem values are unverified and recorded inTechnicalDebt.md.Tested
python3 tools/check_conventions.py --base origin/mainandgit diff --check origin/mainpass cleanly.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.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-11T14:14:54Z.
Progress report (
33ae282→ ce1ca8b)➖ System libraries: 86.25% (+0.0%, +1 implemented functions)
✅ 1 implemented
pathconf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-11T14:46:10Z.
Checked on Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release, with this PR (68ab3859) merged onto
maina11c8f7f.guest_kernel_syspasses 5/5 (--repeat until-fail:5).guest_kernel_sysaborts in the symlink cases before it reachespathconf(symlink: Function not implemented). That is themainbug #3510 fixes. With #3510's change stacked it passes 5/5, and there are no warnings in the changed files.pathconfon both. OnmainWindows stops atFAIL: unresolved ELF import oc98+zOImus (pathconf) from libkernel_sys.prx; with this PR it stops atFAIL: unresolved ELF import DxmIMUQ-wXY (pthread_attr_getstackaddr) from libkernel.prx(#3494). Linux gives the same:undefined symbol: DxmIMUQ-wXY.Heads-up: this PR and #3510 conflict in the constants block at the top of
libkernel_sys/Export.cpp, so whichever merges second needs a small rebase.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T14:59:56Z.
Cross-linking for the review: this implements the fix tracked in #3502, which has an independent Linux verification on that issue — full suite 832/832 (CachyOS, GCC 16.2.1, including the Vulkan suites on AMD RX 9070 XT / RADV), conventions check clean. The rebased reference branch there also documents the one conflict that appears against current
main(the newer Windows privilege constant inlibkernel_sys/Export.cpp).Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:15:39Z.
Conflicts with main in
core/libs/prx/libkernel_sys/Export.cpp(the constants block, after #3510) anddocs/dev/TechnicalDebt.md; please rebase.Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-12T00:32:23Z.
Heads-up from a Windows validation attempt: this branch (
68ab3859, basea11c8f7f) no longer merges ontomainbab7b328.libkernel_sys/Export.cppconflicts in the constants block (both sides defineGuestEloop/GuestEnametoolong;mainaddedGuestEdeadlk,GuestEagain,GuestEnotempty,GuestEoverflowthrough #3685, #3555, #3485 and #3510, and thecreationMaskatomic moved), plus theforkbullet next to the newpathconfbullet inTechnicalDebt.md. Porpoise (PPSA99764) still stops onpathconfon currentmain(third catalog run, #1578), so a rebase would let it progress.Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-12T13:00:11Z.
Rebased onto
main33ae282e(now ce1ca8bf). Conflicts resolved:libkernel_sys/Export.cpp: kept main's constants (includingGuestEloop/GuestEnametoolong) and added only thepathconfones. Dropped the localPathErrorwrapper, since main'sGuestErrornow mapsELOOPandENAMETOOLONGitself, and switched the path lookup toResolvePathError_nid_no_patchlikereadlink.TechnicalDebt.md: kept main'sfork/umaskbullet and added thepathconfbullet after it.Tested on Linux (Arch, Release):
guest_kernel_syspasses 5/5 (--repeat until-fail:5),check_conventions.pyandcheck_test_registration.pyare clean. Not re-run on Windows.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-12T13:36:01Z.
I checked ce1ca8bf on both OSes with Porpoise (PPSA99764, catalog 3.0):
main33ae282estops atpathconf:undefined symbol: oc98+zOImus (pathconf)FAIL: unresolved ELF import oc98+zOImus (pathconf) from libkernel_sys.prxpathconfresolves and the next stop ischroot:undefined symbol: AKknh8Cx-V8 (chroot)FAIL: unresolved ELF import AKknh8Cx-V8 (chroot) from libkernel_sys.prxguest_kernel_syspasses 5/5 (--repeat until-fail:5) on both. No warnings inlibkernel_sys/Export.cpporGuestKernelSys.cpp.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T13:49:42Z.
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)pathconf_nid_postfixpathconf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:53:00Z.
Rebased onto current
main(conflicts inlibkernel_sys/Export.cpp, and thepathconfdebt entry moved todocs/dev/debt/libkernel_sys.mdafter the debt split). Checked the constants against FreeBSD 11ufs_pathconf, built and ran the libs tests on the rebase (90/90), andguest_kernel_sysfails to link without the change. Merging once CI is green.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T21:00:48Z.
mainmoved again (a new conflict inlibkernel_sys/Export.cpp,HasLongComponentnext to the newReadNativeLink). Rebased keeping both, rebuilt and ran the libs tests (154/154 pass). Merging once CI is green.