fix(libkernel): report socket status from fstat on a guest socket #4903
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4903"
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 ErenYeager1836 on 2026-10-13T03:14:20Z.
Carries
milescoviello:fix/fstat-guest-socket@505bc9b9unchanged (rebased onto current main and debt conflict resolved). Fixes #4051.What
fstaton a guest socket descriptor passed the guest number (from0x10000000up) to the host, which has no such descriptor, so it threwFillFileStat: fstat failed for fd 268435460;sceKernelFstatreturnedEBADFfor the same descriptor. FreeBSD fills the stat buffer for a socket throughsoo_stat(sys/kern/sys_socket.c), which reportsS_IFSOCK, read/write mode bits from send/recv state, andst_size = sbavail - sb_ctl.fstat/sceKernelFstatnow answer that way for guest sockets instead of throwing.Tested
guest_socket_pairaborts withmain's sources (theFillFileStatthrow) and passes with the change; allguest_*tests pass (289/289).python tools/check_conventions.py --base upstream/mainpasses with 0 errors.python tools/check_test_registration.pypasses (707 test executables).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T06:42:53Z.
Windows test: head
618bcf323merged onto currentmainea2bbefb2(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest with the filterguest_socket_pair: guest_socket_pair passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-13T07:24:53Z.
Linux test (Arch, GCC 16.2.1, glibc, Release), this PR merged onto
main7e181fcc3together with #4927, #4903, #4877, #4822 and #4823 (no conflicts):guest_socket_pairpasses. With this PR's source change reverted (test kept),guest_socket_pairfails on Linux, so the check guards the change on Linux too.