Files
AnyPS5/core/libs/prx/libkernel/File
mattogepetoandClaude Opus 5.5 d915e5835a fix(libkernel): check for a directory with fstat before getdents on Linux
The Linux path mapped ENOTDIR from getdents64 to EINVAL, but a pipe or FIFO
still failed with ESPIPE from the lseek that reads the base offset first.
FreeBSD 11.4's kern_getdirentries returns EINVAL for any descriptor that is
not a directory vnode, pipes included, and EBADF for one that is not open.

Check the descriptor with fstat before the lseek: EBADF and other host
errors are passed through, and anything that is not a directory returns
EINVAL. The getdents64 error line is unchanged again, and the technical debt
entry is removed since no difference is left.

Written with AI assistance (Claude).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 16:41:22 +02:00
..