feat(libkernel_sys): implement fchown #6411
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6411"
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 Nixitov on 2026-10-15T14:15:56Z.
What
Implement
fchownin libkernel_sys. Morrowind (mshivam019/morrowind-ps5) and Morrowind / OpenMW (PPSA99630) stop at it on currentmain:(#5562 was the same change, closed for naming no title. It cannot be reopened ΓÇö GitHub reported that the branch "was force-pushed or recreated" while the PR was closed ΓÇö so this is re-filed with the title evidence.)
Ownership is not modelled: the guest's own owner and group (0) and the unchanged value (-1) are accepted, a descriptor that is not open fails with
EBADF, and any other owner or group throws, naming it. The descriptor is read withfstat, ignoring the CRT's invalid-parameter handler on Windows the wayDescriptorControldoes. Recorded indocs/dev/debt/libkernel_sys.md.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release.
guest_kernel_sysis extended:fchownaccepts(0, 0)and(-1, -1), fails an invalid descriptor withEBADF, and throws for owner 1 or group 1; it passes.mshivam019/morrowind-ps5, v1.0.1 windows asset),eboot.binunwrapped and relinked with the built relinker--windows: on currentmainit stops atruyD9QkP8dI(fchown); with this change it resolves every start-up import and transfers control to the ELF entry point.main5d9dcc42dthe title stops at load with./app.elf: symbol lookup error: ./app.elf: undefined symbol: ruyD9QkP8dI(fchown, libkernel_sys); with this PR Morrowind / OpenMW (PPSA99630, from the homebrew catalog) loads and runs to OpenMW's own check,Fatal error: Archive 'Morrowind.bsa' not found, and exits with status 0.python tools/check_conventions.py --base origin/mainpasses.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)mshivam019/morrowind-ps5)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T14:16:43Z.
Progress report (
940eba9→443df05)📉 System libraries: 88.69% (-0.03%, +1 declared functions)
🆕 1 declared as stubs
fchown_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T14:33:58Z.
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)core/libs/prx/libkernel_sys/Export.cppL511core/libs/tests/GuestKernelSys.cppL55, L567-568Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libkernel_sys/Export.cppcore/libs/tests/GuestKernelSys.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/tests/GuestKernelSys.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/prx/libkernel_sys/Export.cppcore/libs/tests/GuestKernelSys.cppdocs/dev/debt/libkernel_sys.mdImported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-16T02:40:45Z.
A title that reaches this: Morrowind / OpenMW (PPSA99630) from the homebrew catalog, on Linux (Intel Arc, Mesa ANV).
main5d9dcc42d: stops at load with./app.elf: symbol lookup error: ./app.elf: undefined symbol: ruyD9QkP8dI(fchown, libkernel_sys).main5d9dcc42d+ this PR: it loads and runs to OpenMW's own check,Fatal error: Archive 'Morrowind.bsa' not found, then[ps5-opengl-native] gate completed status=1and exits with status 0 (no game data was installed for the test).AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-18T15:41:45Z.
Windows run of head
443df0551, merged ontomaine5f18ea99(clean merge). Windows 11, RTX 3080, WinLibs GCC 15.2, Release:guest_kernel_syspasses 5/5 (--repeat until-fail:5); no warnings inlibkernel_sys/Export.cpporGuestKernelSys.cpp.main: fails to load with an unresolvedruyD9QkP8dI(fchown) from libkernel_sys, its only missing import (0xC0000139, no window).OpenMW PS5: entering engine,PS5 on-screen keyboard ready,OpenGL Renderer: PS5 AGC / 4.6 (Compatibility Profile) Mesa 26.2.0andUsing reverse-z depth buffer. It then exits 0 after about 1 s with[E] Fatal error: Archive 'Morrowind.bsa' not found, which is the expected stop without user-supplied game data. No UCRT or FATAL reports.AI-assisted: yes