Files
AnyPS5/core/libs/prx/libkernel/File
xXPBSXxandClaude Sonnet 5.5 6457edc2fb fix(libkernel): fail fcntl F_DUPFD with EINVAL when the minimum descriptor is beyond the open file limit on Windows
fcntl(fd, F_DUPFD, min) with min at or above RLIMIT_NOFILE duplicated the
descriptor repeatedly until the CRT table was full and then failed with
EMFILE, after opening thousands of descriptors. FreeBSD checks the minimum
first: kern_dup returns EINVAL for FDDUP_FCNTL when new < 0 or
new >= maxfd (sys/kern/kern_descrip.c:836-840). Linux already answers
EINVAL through the host fcntl. Check the minimum against the guest
RLIMIT_NOFILE before the Windows loop.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 01:52:31 +02:00
..