fix(libkernel): report the starting entry index in getdirentries basep on Windows #8591
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8591"
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-20T17:40:59Z.
What
Windows
sceKernelGetdirentriesstored0in*basepon every read. FreeBSD stores the offset the read started at (kern_getdirentries,*basep = loff).ReadDirectoryDescriptornow returns the index of the first entry of the read (the unitlseektakes on these descriptors, see the Windows directory descriptor entry indocs/dev/debt/libkernel.md), andguest_directory_entriesis registered on Windows (previouslyNOT WIN32; it also gets the WindowsPATH, unwind section and-fasynchronous-unwind-tableslikeguest_directory_rewind).Does not touch the POSIX implementation. Source for the behaviour: FreeBSD 11.4
sys/kern/vfs_syscalls.ckern_getdirentries(loff = auio.uio_offset = foffset; ... *basep = loff).Fixes #8590
Tested
Windows 10 (10.0.19045), WinLibs GCC 15.2.0 Release,
ctest -N -R ^guest_directory_entries$lists exactly 1 test.guest_directory_entriesfails 3/3 (Directory entry check failed at line 81, 0xc0000409).python tools/check_conventions.py --base upstream/main: passed.Not tested: Linux/macOS (only CMake registration lines changed for them: the test stays registered unconditionally; the Windows-only
guest_directory_close/positioned_closetests keep their Windows condition). GPUs tested: n/a.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T18:15:12Z.
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/DirectoryDescriptor.cppL156-161core/libs/prx/libkernel/File/src/Stdio.cppL1104-1105Some 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/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/File/src/DirectoryDescriptor.cppcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/CMakeLists.txtcore/libs/prx/libkernel/File/src/Stdio.cppcore/libs/prx/libkernel/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:42:35Z.
I manually compared #8520: its Windows
sceKernelGetdirentriespath also setsbasepfrom aDirectoryDescriptorcursor while adding archived-directory support. It currently does that with a separateSeekDirectoryDescriptorcall followed byReadDirectoryDescriptor; this PR’s out-parameter captures the start under the read lock, avoiding a stale base if two threads share the descriptor. The PRs overlap in this path but are not the same overall feature. Could you coordinate with #8520’s author on merge order and whether that PR should adopt this helper change? #8520 is currently dirty againstmainand has requested changes.Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T18:46:28Z.
Thanks for comparing it with #8520. You are right that both touch the Windows
sceKernelGetdirentriesbaseppath: this PR is the smaller change (ReadDirectoryDescriptorreturns the start index under the read lock, andguest_directory_entriesis registered on Windows), #8520 adds archived-directory support. I am happy to rebase onto whichever of the two lands first. If #8520's author wants to adopt the out-parameter inReadDirectoryDescriptor, I have no objection and will then rebase this PR down to the test registration; I have not contacted that author yet.AI-assisted (Claude Code).