feat(libkernel_sys): implement fpathconf and _fpathconf #10060
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10060"
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 xXPBSXx on 2026-10-23T07:32:52Z.
What
Based on #6525 (QuentinRemond, head
8c2943089b, authorship kept); the original no longer compiles onmain(GuestEbadfis defined twice since #6411) andlibkernel_sys.prxwould not load (DescriptorIsOpen_nid_no_patchis not exported by the patchedlibkernel.prx). Implementsfpathconfand_fpathconfinlibkernel_sys: a descriptor that is not open fails withEBADF; the values are the FreeBSD 11 UFS constants thatpathconfalready reports, now from onePathConfigurationValuehelper; names that depend on the mount or the kernel throw; unknown names fail withEINVAL. The rebase drops the duplicate constant and keepsmain'sENOTDIRhandling inpathconf; the descriptor is checked withfstatasfchowndoes.Fixes: none
Tested
Measured on
main9d6adeb550plus these two commits (git merge-treeagainst the currentmain0db47b263dis clean, the head is unchanged): Windows 10 19045, WinLibs GCC 15.2.0, Release:ctest -R '^(patched_libraries|guest_kernel_sys)$'passes 2 of 2. WSL2 Ubuntu 24.04 (virtualised kernel, not bare-metal), GCC 13.3.0, Release: passes 2 of 2. Before the descriptor fix (the earlier baseab347d144d, only the rebase of the original commit),patched_librariesfailed on both: Windowslibkernel_sys.prx: LoadLibraryEx failed with error 127(359 patched libraries loaded, 1 failed), Linuxlibkernel_sys.prx: undefined symbol: _Z29DescriptorIsOpen_nid_no_patchi;guest_kernel_syspassed there, as it loads the unpatched PRXs.tools/check_conventions.py --base upstream/main: no error, one warning (thelibkernel_sys.mddebt entry is 1260 characters, from the original PR). Not tested: macOS, a title run.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)Co-authored by the original author of #6525.
AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T13:26:16Z.
Review: DISMISSED
Reviewed exact head
fba61c0da01cf7fd4346cb94a6b3a9d86b68862c. The implementation addresses the two FreeBSDkern_fpathconfcases raised in the thread:_PC_ASYNC_IOreturns 200112 after validating the descriptor, and FIFO descriptors return 512 for_PC_PIPE_BUFandEINVALfor other names. The added guest tests cover both exported aliases, file/directory descriptors, invalid descriptors, and both pipe ends. The author reports Windows and WSL2 focusedpatched_librariesandguest_kernel_sysruns passing 2/2; I did not independently reproduce those runs here because CMake configuration stops before generation: this checkout lacks the3rdparty/SDL2CMake project and the environment lacks XRandR development support.git diff --checkandtools/check_conventions.py --base upstream/mainpass locally. Hosted eligibility, conventions, labels, and report checks are green; platform build jobs are skipped by workflow policy.A landing-order item remains: the exact-head three-way preview between #10060 and #10196 conflicts in
core/libs/prx/libkernel_sys/Export.cppanddocs/dev/debt/libkernel_sys.md. #10196's body acknowledges the shared switch and says it will carry #10060's changes if #10060 lands first, but both checklists currently sayDepends on: none, and I don't see an explicit agreement from both authors on the order. Please coordinate and record the agreed dependency/order in the PR body, while preserving both implementations and debt documentation whichever lands second. This is a sequencing request only; I am not asking either author to close their PR.