mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
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]>