feat(libkernel_sys): implement openat #3968
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3968"
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 babyhuey on 2026-10-11T20:08:49Z.
What
Exports
openat(A8Yk5AhNDck) from libkernel_sys, the module titles import it from.AT_FDCWD(-100) and absolute paths go toopen, so guest path aliases, case-insensitive matching and the guest root apply as before.fchdirdoes it (#3392): the recorded path on Windows, the/proc/self/fdlink on Linux. It returnsEBADFfor a descriptor that is not open andENOTDIRfor one that is not a directory.modeis read from the variadic arguments only withO_CREAT, as_opendoes, including the SysVva_liston Windows.sceKernelOpenafter path resolution is moved into a staticOpenNativewith no change in behaviour. libkernel also gets a smallOpenInDirectory_nid_no_patchhelper.fchdirlists the limits. A path relative to a descriptor does not go through aliases or case-insensitive matching, and a..component is not kept inside the guest root. As inopen,O_NOFOLLOWandO_NONBLOCKare ignored.ProsperoTV (PPSA99003, catalog 01.000.060) opens a directory with
O_DIRECTORY | O_NOFOLLOW, thenopenats entries in it withO_NONBLOCK | O_NOFOLLOW. Onmain12c22662it stops atopenat; tracked in #1578:app.elf: symbol lookup error: app.elf: undefined symbol: A8Yk5AhNDck (openat)FAIL: unresolved ELF import A8Yk5AhNDck (openat) from libkernel_sys.prxpollafter opening/dev/crypto(Linux:poll: descriptor 6 is not a socket; Windows:poll: descriptor 4 is not a socket). #3649 fixes that.Vulkan device ready, then stops at the headlessDisplayWindow. Windows renders, then stops atAGC graphics: last provoking vertex with explicit per-vertex flat interpolation is unsupported(#3581). That is a graphics gap, not an import.Tested
Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release:
guest_kernel_syspasses 5/5 (--repeat until-fail:5) on both. There are no new warnings inOpen.cpp,libkernel_sys/Export.cpporGuestKernelSys.cpp. The new cases cover:O_CREAT | O_EXCLand mode0644, thenEEXISTon a second tryENOENTfor a missing nameAT_FDCWDwith a relative pathENOTDIRfor a file descriptor,EBADFfor -1EFAULTfor a null path andENOENTfor an empty oneWith #3649 stacked,
guest_pollalso passes 5/5 on Windows.check_conventions.pypasses. Rebased ontomain51e2c511, over #3485 (sceKernelOpennow resolves throughResolvePathError_nid_no_patchbeforeOpenNative) and #3685 (libkernel_sys errno constants):guest_kernel_sys5/5 on both and the same ProsperoTV results. Windows ran with #4021 stacked, sincemaindoes not build on Windows without it.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-11T20:09:08Z.
Progress report (
0694c57→c154b8b)📈 System libraries: 85.72% (+0.01%, +1 implemented functions)
✅ 1 implemented
openat_nid_postfixImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T22:44:23Z.
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/File/src/Open.cppL188-199core/libs/prx/libkernel_sys/Export.cppL1docs/dev/TechnicalDebt.mdL391