Repository navigation
feat(libkernel_sys): implement fstatat - #7563
Conversation
|
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.
Some 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.
|
|
Windows run. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, The build is clean and AI-assisted |
f4ea3ea to
15649b7
Compare
|
Rechecked against current main: the |
What
Implements
fstatat(t6haf4s-eE0) in libkernel_sys, next toopenat,mkdirat,fchmodatandunlinkat, and following them:AT_FDCWD(-100) and absolute paths go tostat, or tolstatwithAT_SYMLINK_NOFOLLOW(0x200).StatInDirectory_nid_no_patch, the same wayOpenInDirectory_nid_no_patchdoes foropenat. It returnsEBADFfor a descriptor that is not open andENOTDIRfor one that is not a directory. Following links, it usessceKernelStat's native-path code, moved intoStatNativeunchanged, so a trailing/on a non-directory givesENOTDIRas instat. Without following, it usesFile::FillLinkStatlikelstat.AT_SYMLINK_NOFOLLOWreturnEINVAL; a null pathEFAULT; an empty oneENOENT.The technical debt entry follows the other
*atfunctions (no guest path aliases or case-insensitive matching below a descriptor,..not kept inside the guest root).Tested
On 15649b7 (rebased onto
maina373e85 after #6411 merged), 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. The new cases cover a file and a directory below a descriptor, a trailing/,AT_SYMLINK_NOFOLLOW,AT_FDCWD, an absolute guest path,ENOENT,EFAULT,EINVAL,EBADFandENOTDIRfor a file descriptor, plus a symbolic link followed and not followed (not on Windows, like the existingfchmodatlink cases).Stremio Plus (PPSA74126, catalog release 0.5.11) stops on
mainwithsymbol lookup error: ... undefined symbol: t6haf4s-eE0 (fstatat); nothing open provides it (checked all 851 open PR diffs). With this PR:fstatat, starts its threads and stops at the headlessDisplayWindowVulkan check, like the other UI titles in a headless run.main5bf2e13 it fails to load (unresolved ELF import t6haf4s-eE0 (fstatat) from libkernel_sys.prx, exit0xC0000139, no window). With this PR it runs the full 60 s at 59.94 fps with no UCRT reports and draws its "Link your account" page (QR code, link code, countdown and the "Request a new link" button). Rechecked on the rebased head: 59.93 FPS, same page; Morrowind (PPSA99630) still reaches its ownArchive 'Morrowind.bsa' not foundexit through feat(libkernel_sys): implement fchown #6411'sfchown.The stat consumers (
ctest -R "filesystem|fstat|timestamp|app_archive|kernel_sys|stat", 39 tests on the rebased head) also pass 5/5 on both aftersceKernelStatmoved toStatNative, as they do onmain.check_conventions.pypasses.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)fchown) merged first; this is rebased onto it, keeping both functions and both test blocks inlibkernel_sys/Export.cppandGuestKernelSys.cpp.