AnyPS5/core/libs/prx/libkernel/File/include
screamm 01b7bb3e2f feat(libkernel): support ioctl on non-socket descriptors
ioctl and _ioctl answered EBADF for every descriptor outside the
libSceNet socket table. Decoded call sites: PS5MC (PPSA99420, FIONBIO x3,
FIONREAD x2, TIOCGWINSZ x3), ProsperoTV (PPSA99003, FIONBIO on a pipe
once poll on pipes is in), XPSemu (PPSA97358, 21 sites).

Following FreeBSD 11.4 kern_ioctl (sys/kern/sys_generic.c:758),
vn_ioctl (sys/kern/vfs_vnops.c:1488), pipe_ioctl (sys/kern/sys_pipe.c:1346)
and randomdev_ioctl (sys/dev/random/randomdev.c:301), release/11.4.0
8c639945: FIONBIO sets or clears O_NONBLOCK through the same status
flags as fcntl F_SETFL (EFAULT for a null argument before EBADF);
FIONREAD reports the size past the offset of a file, the queued bytes of
a pipe's read end, 0 on its write end, ENOTTY on the random device, and
throws on a directory or another character device; termios requests
(group 't', TIOCGWINSZ included) fail with ENOTTY, as tcgetattr already
takes these descriptors as not a terminal; any other request throws
naming the request and descriptor kind. Sockets keep their path
unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 12:17:26 +05:30
..
DescriptorControl.hpp feat(libkernel): support ioctl on non-socket descriptors 2026-10-12 12:17:26 +05:30
DirectoryDescriptor.hpp feat(libkernel_sys): implement openat 2026-10-11 18:01:11 -04:00
File.hpp feat(libkernel): implement sceKernelFcntl 2026-10-11 00:06:02 +02:00
FileFlags.hpp feat(libkernel): libkernel file functions impl 2026-09-13 12:07:47 +03:00
FileLock.hpp fix(libkernel): give flock BSD semantics on Windows 2026-10-10 06:49:20 +02:00
KernelStatfs.hpp feat(libc): implement guest fstatvfs volume statistics 2026-10-11 15:57:20 +02:00
NativeStat.hpp feat(libkernel): implement lstat 2026-10-09 17:30:43 -04:00
RandomDevice.hpp fix(libkernel): maintain random device and file lock invariants in dup and dup2 2026-10-10 15:54:21 +04:00
SharedMemory.hpp fix(libkernel): preserve patched loading and shared-memory object identity 2026-10-11 23:40:46 +02:00
WindowsFileTime.hpp fix(libkernel): preserve Windows file timestamp precision 2026-10-10 01:51:56 +02:00