feat(libkernel): answer TCP_NODELAY, SO_NOSIGPIPE and SO_NBIO on a guest socket #5565

Merged
Dripl1x merged 1 commit from upstream-pr/5565 into main 2026-10-15 12:11:15 +00:00
Dripl1x commented 2026-10-14 00:02:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-14T00:02:16Z.


What

setsockopt and getsockopt on a socket from socket() answer the SOL_SOCKET options #4796 added and fail every other option and level with ENOPROTOOPT. This PR answers three more, the ones the discussion of #4796 left as a separate change. They are added to #4796's structure: the handling is in Socket/src/SocketOptions.cpp, and the per-socket state is in SocketOptionState under modeMutex.

  • TCP_NODELAY (IPPROTO_TCP, 1) is set on the host socket and reads back as TF_NODELAY (4), as FreeBSD 11.4's tcp_default_ctloutput returns it. The IPPROTO_TCP level on a datagram or AF_UNIX socket fails with EINVAL, as ip_ctloutput and uipc_ctloutput answer it. Every other TCP option still fails with ENOPROTOOPT. setsockopt and getsockopt pass level 6 to the new SetTcpLevelOption and GetTcpLevelOption, and SOL_SOCKET to the existing functions.
  • SO_NOSIGPIPE (0x800) is kept in SocketOptionState::noSignal and reads back as its own bit (sogetopt). It takes effect: on Linux a send, sendto, sendmsg or write on that socket passes MSG_NOSIGNAL to the host, so a broken connection gives EPIPE without the host's SIGPIPE ending the title, as kern_sendit and soo_write decide it. send and sendto read the flag under modeMutex; sendmsg and write go through them. An accepted socket takes the option from its listener, as sonewconn copies the options. Windows raises no signal either way.
  • SO_NBIO (0x1200), the console's own non-blocking option, switches the host socket with FIONBIO and reads back as 0 or 1, as sceNetSetsockopt and sceNetGetsockopt treat it here. The non-blocking flag moves from Socket into SocketOptionState, so this option, fcntl, ioctl(FIONBIO) and accept use the same state.
  • The three options follow the checks of the options already in SocketOptions.cpp. A value shorter than an int fails with EINVAL (sooptcopyin), and so does a null value. getsockopt copies as many bytes as the buffer holds. FreeBSD's kern_setsockopt returns EFAULT for a null value instead; that applies to every option here and is recorded in the debt entry rather than changed.
  • guest_socket_options expected SO_NOSIGPIPE to fail. It now checks that the option reads back as its bit. The debt entry for SocketOptions.cpp and the sentence on SIGPIPE in the socket read/write entry are updated.

Titles that ask for them:

  • ProsperoStore (PPSA99000) sets SO_NBIO on every curl socket and fails the request when the call fails; VITA5 (PPSA39410) returns the error of the same call. On main the call fails with ENOPROTOOPT. This is read from their sources; neither title was run.
  • screamm's trace of ProsperoRadio (PPSA99001) in #4796 shows TCP_NODELAY, SO_NOSIGPIPE and option 0x1200 failing with ENOPROTOOPT on main; curl carries on without them.
  • A static survey of the 63 executables of ps5-homebrew-catalog (not run): TCP_NODELAY is set by 29 titles, SO_NOSIGPIPE by 28, SO_NBIO by 18 and read by 12. The level and option were recovered at 840 of 2661 setsockopt call sites, so these are lower bounds. The lists and the method are in this comment.

Related:

  • #5020, now merged, added F_GETFD and F_SETFD in front of the F_GETFL line of fcntl. This branch is rebased onto it, and that line reads the flag from SocketOptionState.
  • #5617 is stacked on this PR and adds SO_SNDTIMEO and SO_RCVTIMEO to the same structure.

Tested

Windows 11, Ryzen 7 5800H, WinLibs MinGW-w64 GCC 15.2.0 r7; Ubuntu 26.04 under WSL, GCC 15.2.0. Release, BUILD_TESTING=ON, root configuration with FFMPEG_PREBUILT_DIR pointed at an already unpacked package. Head 7e79f36ed on main 4c1de0c0c.

  • The new test guest_socket_stream_options covers the three options on a loopback TCP pair, a datagram socket and an AF_UNIX pair. It checks values and read-back, short and truncated arguments, and the EINVAL of the TCP level on the other socket kinds. It also checks EAGAIN from a receive after SO_NBIO and F_GETFL following it, inheritance by an accepted socket, and EPIPE from send and write after shutdown(SHUT_WR). On Linux it counts host SIGPIPE deliveries: none while SO_NOSIGPIPE is set or MSG_NOSIGNAL is passed, and one after the option is cleared.
  • Negative control: with SocketOptions.hpp, SocketOptions.cpp and Udp.cpp from main and the tests of this PR, guest_socket_stream_options fails on both systems with socket stream option check failed at line 91, errno 42. guest_socket_options fails with setsockopt of an integer option failed (errno 42).
  • Windows: guest_socket_stream_options and guest_socket_options pass 20 of 20 repeated runs. Of the twelve socket tests eleven pass. guest_udp times out after 20 s, and does so on main too: on this machine a datagram to [::1] is never delivered, even between two plain host sockets outside AnyPS5.
  • Linux: the twelve socket tests pass in 0.86 s, guest_udp included.
  • The conventions checker, including the title and description, and git diff --check pass.

Not tested: any title, a console, macOS, the full test suite. Full PR builds need a collaborator's manual Build run.

Checklist

  • Based on current main; no other open PR implements these three options
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • No new third-party code or dependencies
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none; no title was run with this change
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4851033627 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-14T00:02:16Z. --- ### What `setsockopt` and `getsockopt` on a socket from `socket()` answer the SOL_SOCKET options #4796 added and fail every other option and level with `ENOPROTOOPT`. This PR answers three more, the ones the discussion of #4796 left as a separate change. They are added to #4796's structure: the handling is in `Socket/src/SocketOptions.cpp`, and the per-socket state is in `SocketOptionState` under `modeMutex`. - `TCP_NODELAY` (`IPPROTO_TCP`, 1) is set on the host socket and reads back as `TF_NODELAY` (4), as FreeBSD 11.4's [`tcp_default_ctloutput`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/netinet/tcp_usrreq.c#L1626-L1648) [returns it](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/netinet/tcp_usrreq.c#L1860-L1861). The `IPPROTO_TCP` level on a datagram or `AF_UNIX` socket fails with `EINVAL`, as [`ip_ctloutput`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/netinet/ip_output.c#L943-L944) and [`uipc_ctloutput`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/uipc_usrreq.c#L1228-L1229) answer it. Every other TCP option still fails with `ENOPROTOOPT`. `setsockopt` and `getsockopt` pass level 6 to the new `SetTcpLevelOption` and `GetTcpLevelOption`, and SOL_SOCKET to the existing functions. - `SO_NOSIGPIPE` (`0x800`) is kept in `SocketOptionState::noSignal` and reads back as its own bit ([`sogetopt`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/uipc_socket.c#L2807-L2808)). It takes effect: on Linux a `send`, `sendto`, `sendmsg` or `write` on that socket passes `MSG_NOSIGNAL` to the host, so a broken connection gives `EPIPE` without the host's `SIGPIPE` ending the title, as [`kern_sendit`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/uipc_syscalls.c#L890-L895) and [`soo_write`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/sys_socket.c#L147-L151) decide it. `send` and `sendto` read the flag under `modeMutex`; `sendmsg` and `write` go through them. An accepted socket takes the option from its listener, as [`sonewconn`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/uipc_socket.c#L603) copies the options. Windows raises no signal either way. - `SO_NBIO` (`0x1200`), the console's own non-blocking option, switches the host socket with `FIONBIO` and reads back as 0 or 1, as `sceNetSetsockopt` and `sceNetGetsockopt` treat it here. The non-blocking flag moves from `Socket` into `SocketOptionState`, so this option, `fcntl`, `ioctl(FIONBIO)` and `accept` use the same state. - The three options follow the checks of the options already in `SocketOptions.cpp`. A value shorter than an `int` fails with `EINVAL` ([`sooptcopyin`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/uipc_socket.c#L2474-L2477)), and so does a null value. `getsockopt` copies as many bytes as the buffer holds. FreeBSD's [`kern_setsockopt`](https://github.com/freebsd/freebsd-src/blob/8c639945a44588f6cfdddfb057bb5aad88735da0/sys/kern/uipc_syscalls.c#L1414-L1415) returns `EFAULT` for a null value instead; that applies to every option here and is recorded in the debt entry rather than changed. - `guest_socket_options` expected `SO_NOSIGPIPE` to fail. It now checks that the option reads back as its bit. The debt entry for `SocketOptions.cpp` and the sentence on `SIGPIPE` in the socket read/write entry are updated. Titles that ask for them: - ProsperoStore (PPSA99000) sets `SO_NBIO` on every curl socket and [fails the request when the call fails](https://github.com/blackbearreloaded/ProsperoStore/blob/162d0f05a6f7a1d9af342907b2d2c3d0db210a8c/src/net/curl_request.cpp#L110-L117); VITA5 (PPSA39410) [returns the error of the same call](https://github.com/StonedModder/VITA5/blob/414fa550a86ba7f0f6aed580b844a3ffe9cd613e/core/src/vd_ipc.c#L126-L130). On `main` the call fails with `ENOPROTOOPT`. This is read from their sources; neither title was run. - screamm's trace of ProsperoRadio (PPSA99001) in [#4796](https://github.com/boykopovar/AnyPS5/pull/4796#issuecomment-6140849638) shows `TCP_NODELAY`, `SO_NOSIGPIPE` and option `0x1200` failing with `ENOPROTOOPT` on `main`; curl carries on without them. - A static survey of the 63 executables of [ps5-homebrew-catalog](https://github.com/blackbearreloaded/ps5-homebrew-catalog) (not run): `TCP_NODELAY` is set by 29 titles, `SO_NOSIGPIPE` by 28, `SO_NBIO` by 18 and read by 12. The level and option were recovered at 840 of 2661 `setsockopt` call sites, so these are lower bounds. The lists and the method are in [this comment](https://github.com/boykopovar/AnyPS5/pull/5565#issuecomment-6157794470). Related: - #5020, now merged, added `F_GETFD` and `F_SETFD` in front of the `F_GETFL` line of `fcntl`. This branch is rebased onto it, and that line reads the flag from `SocketOptionState`. - #5617 is stacked on this PR and adds `SO_SNDTIMEO` and `SO_RCVTIMEO` to the same structure. ### Tested Windows 11, Ryzen 7 5800H, WinLibs MinGW-w64 GCC 15.2.0 r7; Ubuntu 26.04 under WSL, GCC 15.2.0. Release, `BUILD_TESTING=ON`, root configuration with `FFMPEG_PREBUILT_DIR` pointed at an already unpacked package. Head `7e79f36ed` on `main` `4c1de0c0c`. - The new test `guest_socket_stream_options` covers the three options on a loopback TCP pair, a datagram socket and an `AF_UNIX` pair. It checks values and read-back, short and truncated arguments, and the `EINVAL` of the TCP level on the other socket kinds. It also checks `EAGAIN` from a receive after `SO_NBIO` and `F_GETFL` following it, inheritance by an accepted socket, and `EPIPE` from `send` and `write` after `shutdown(SHUT_WR)`. On Linux it counts host `SIGPIPE` deliveries: none while `SO_NOSIGPIPE` is set or `MSG_NOSIGNAL` is passed, and one after the option is cleared. - Negative control: with `SocketOptions.hpp`, `SocketOptions.cpp` and `Udp.cpp` from `main` and the tests of this PR, `guest_socket_stream_options` fails on both systems with `socket stream option check failed at line 91, errno 42`. `guest_socket_options` fails with `setsockopt of an integer option failed (errno 42)`. - Windows: `guest_socket_stream_options` and `guest_socket_options` pass 20 of 20 repeated runs. Of the twelve socket tests eleven pass. `guest_udp` times out after 20 s, and does so on `main` too: on this machine a datagram to `[::1]` is never delivered, even between two plain host sockets outside AnyPS5. - Linux: the twelve socket tests pass in 0.86 s, `guest_udp` included. - The conventions checker, including the title and description, and `git diff --check` pass. Not tested: any title, a console, macOS, the full test suite. Full PR builds need a collaborator's manual Build run. ### Checklist - [x] Based on current `main`; no other open PR implements these three options - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] No new third-party code or dependencies - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none; no title was run with this change - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Dripl1x commented 2026-10-14 00:02:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-14T00:02:42Z.


Evidence for head 36ff565fe on main d1670009f. Local paths are replaced with <build> and <source>.

Which catalog titles ask for the three options

Call Titles Call sites Titles
setsockopt(IPPROTO_TCP, TCP_NODELAY) 29 105 PPSA17641 SymphonyStation5, PPSA39410 VITA5, PPSA69421 SuperTuxKart, PPSA74126 Stremio Plus, PPSA85300 VLC, PPSA97358 XPSemu, PPSA97510 PSXS5, PPSA98510 SwanStationPS5, PPSA99000 ProsperoStore, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99039 EVO Player, PPSA99141 Mortalfin, PPSA99169 RetroArch, PPSA99177 PS5VR, PPSA99203 PS5SX2, PPSA99288 Nuvio Max'd, PPSA99360 PS5CEMU-HAR, PPSA99420 PS5MC, PPSA99505 Jelly5, PPSA99515 Emby5, PPSA99520 Régie5, PPSA99773 PShare, PPSA99808 PICO-8 for PS5, PPSA99810 PSBox Cloud Gaming, PPSA99930 Forwarder Manager, PPSA99997 Nuvio PS5
getsockopt(IPPROTO_TCP, TCP_NODELAY) 1 1 PPSA99420 PS5MC
setsockopt(SOL_SOCKET, SO_NOSIGPIPE) 28 49 PPSA17641 SymphonyStation5, PPSA69421 SuperTuxKart, PPSA74126 Stremio Plus, PPSA85300 VLC, PPSA97358 XPSemu, PPSA97510 PSXS5, PPSA98001 PokeMMO Prospero, PPSA98510 SwanStationPS5, PPSA99000 ProsperoStore, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99039 EVO Player, PPSA99141 Mortalfin, PPSA99169 RetroArch, PPSA99177 PS5VR, PPSA99203 PS5SX2, PPSA99288 Nuvio Max'd, PPSA99360 PS5CEMU-HAR, PPSA99420 PS5MC, PPSA99505 Jelly5, PPSA99515 Emby5, PPSA99520 Régie5, PPSA99773 PShare, PPSA99808 PICO-8 for PS5, PPSA99930 Forwarder Manager, PPSA99997 Nuvio PS5
getsockopt(SOL_SOCKET, SO_NOSIGPIPE) 1 1 PPSA85300 VLC
setsockopt(SOL_SOCKET, 0x1200) 18 43 PPSA17641 SymphonyStation5, PPSA39410 VITA5, PPSA74126 Stremio Plus, PPSA97510 PSXS5, PPSA98001 PokeMMO Prospero, PPSA98510 SwanStationPS5, PPSA99000 ProsperoStore, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99009 ProsperoLichess, PPSA99288 Nuvio Max'd, PPSA99303 Quake3e, PPSA99764 Porpoise, PPSA99773 PShare, PPSA99810 PSBox Cloud Gaming, PPSA99930 Forwarder Manager
getsockopt(SOL_SOCKET, 0x1200) 12 12 PPSA17641 SymphonyStation5, PPSA74126 Stremio Plus, PPSA97510 PSXS5, PPSA98510 SwanStationPS5, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99009 ProsperoLichess, PPSA99288 Nuvio Max'd, PPSA99773 PShare, PPSA99930 Forwarder Manager

Method: the 65 release archives listed in ps5-homebrew-catalog were downloaded (SHA-256 equal to the catalog records); 63 of them hold an eboot.bin, which was unwrapped from its fake-signed container. Nothing was run. Each call site of setsockopt and getsockopt was found through the import's GOT slot, and the level and option were read from the instructions before it (objdump). That recovers a value only where the compiler loads a constant right before the call: both were recovered at 840 of 2661 setsockopt call sites, so the counts are lower bounds.

Tests

Windows: guest_socket_stream_options, 20 repeated runs
Test project <build>
    Test #955: guest_socket_stream_options ......   Passed    0.06 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.02 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
    Test #955: guest_socket_stream_options ......   Passed    0.03 sec
1/1 Test #955: guest_socket_stream_options ......   Passed    0.02 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) =   0.97 sec
Windows: the nine socket tests (guest_udp times out on this machine with main's Udp.cpp too, see the control)
Test project <build>
1/9 Test #948: guest_socket_error ...............   Passed    0.02 sec
2/9 Test #949: guest_udp ........................***Timeout  20.02 sec
3/9 Test #950: guest_socket_read_write ..........   Passed    0.06 sec
4/9 Test #951: guest_poll .......................   Passed    0.25 sec
5/9 Test #952: guest_tcp ........................   Passed    0.06 sec
6/9 Test #953: guest_socket_pair ................   Passed    0.06 sec
7/9 Test #955: guest_socket_stream_options ......   Passed    0.03 sec
8/9 Test #957: guest_socket_descriptors .........   Passed    0.06 sec
9/9 Test #958: guest_socket_events ..............   Passed    0.22 sec
89% tests passed, 1 tests failed out of 9
Total Test time (real) =  20.85 sec
The following tests FAILED:
	949 - guest_udp (Timeout)
Windows control: Udp.cpp from main, new test
Test project <build>
1/2 Test #947: guest_udp ........................***Timeout  20.02 sec
2/2 Test #953: guest_socket_stream_options ......Exit code 0xc0000409***Exception:   0.24 sec
socket stream option check failed at line 92, errno 42
0% tests passed, 2 tests failed out of 2
Total Test time (real) =  20.35 sec
The following tests FAILED:
	947 - guest_udp (Timeout)
Linux: the ten socket tests
Test project <build>
 1/10 Test #921: guest_socket_error ...............   Passed    0.00 sec
 2/10 Test #922: guest_udp ........................   Passed    0.01 sec
 3/10 Test #923: guest_socket_read_write ..........   Passed    0.05 sec
 4/10 Test #924: guest_poll .......................   Passed    0.18 sec
 5/10 Test #925: guest_select .....................   Passed    0.31 sec
 6/10 Test #926: guest_tcp ........................   Passed    0.01 sec
 7/10 Test #927: guest_socket_pair ................   Passed    0.01 sec
 8/10 Test #929: guest_socket_stream_options ......   Passed    0.01 sec
 9/10 Test #931: guest_socket_descriptors .........   Passed    0.01 sec
10/10 Test #932: guest_socket_events ..............   Passed    0.15 sec
100% tests passed, 0 tests failed out of 10
Total Test time (real) =   0.78 sec
Linux control: Udp.cpp from main, new test
Test project <build>
1/1 Test #927: guest_socket_stream_options ......Subprocess aborted***Exception:   0.01 sec
socket stream option check failed at line 92, errno 42
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   0.03 sec
The following tests FAILED:

The two controls were run on main bfc10637d, before the rebase onto d1670009f; Udp.cpp and the test are the same on both.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157794470 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#issuecomment-6157794470). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-14T00:02:42Z. --- Evidence for head `36ff565fe` on `main` `d1670009f`. Local paths are replaced with `<build>` and `<source>`. ### Which catalog titles ask for the three options | Call | Titles | Call sites | Titles | |---|---:|---:|---| | `setsockopt(IPPROTO_TCP, TCP_NODELAY)` | 29 | 105 | PPSA17641 SymphonyStation5, PPSA39410 VITA5, PPSA69421 SuperTuxKart, PPSA74126 Stremio Plus, PPSA85300 VLC, PPSA97358 XPSemu, PPSA97510 PSXS5, PPSA98510 SwanStationPS5, PPSA99000 ProsperoStore, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99039 EVO Player, PPSA99141 Mortalfin, PPSA99169 RetroArch, PPSA99177 PS5VR, PPSA99203 PS5SX2, PPSA99288 Nuvio Max'd, PPSA99360 PS5CEMU-HAR, PPSA99420 PS5MC, PPSA99505 Jelly5, PPSA99515 Emby5, PPSA99520 Régie5, PPSA99773 PShare, PPSA99808 PICO-8 for PS5, PPSA99810 PSBox Cloud Gaming, PPSA99930 Forwarder Manager, PPSA99997 Nuvio PS5 | | `getsockopt(IPPROTO_TCP, TCP_NODELAY)` | 1 | 1 | PPSA99420 PS5MC | | `setsockopt(SOL_SOCKET, SO_NOSIGPIPE)` | 28 | 49 | PPSA17641 SymphonyStation5, PPSA69421 SuperTuxKart, PPSA74126 Stremio Plus, PPSA85300 VLC, PPSA97358 XPSemu, PPSA97510 PSXS5, PPSA98001 PokeMMO Prospero, PPSA98510 SwanStationPS5, PPSA99000 ProsperoStore, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99039 EVO Player, PPSA99141 Mortalfin, PPSA99169 RetroArch, PPSA99177 PS5VR, PPSA99203 PS5SX2, PPSA99288 Nuvio Max'd, PPSA99360 PS5CEMU-HAR, PPSA99420 PS5MC, PPSA99505 Jelly5, PPSA99515 Emby5, PPSA99520 Régie5, PPSA99773 PShare, PPSA99808 PICO-8 for PS5, PPSA99930 Forwarder Manager, PPSA99997 Nuvio PS5 | | `getsockopt(SOL_SOCKET, SO_NOSIGPIPE)` | 1 | 1 | PPSA85300 VLC | | `setsockopt(SOL_SOCKET, 0x1200)` | 18 | 43 | PPSA17641 SymphonyStation5, PPSA39410 VITA5, PPSA74126 Stremio Plus, PPSA97510 PSXS5, PPSA98001 PokeMMO Prospero, PPSA98510 SwanStationPS5, PPSA99000 ProsperoStore, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99009 ProsperoLichess, PPSA99288 Nuvio Max'd, PPSA99303 Quake3e, PPSA99764 Porpoise, PPSA99773 PShare, PPSA99810 PSBox Cloud Gaming, PPSA99930 Forwarder Manager | | `getsockopt(SOL_SOCKET, 0x1200)` | 12 | 12 | PPSA17641 SymphonyStation5, PPSA74126 Stremio Plus, PPSA97510 PSXS5, PPSA98510 SwanStationPS5, PPSA99001 ProsperoRadio, PPSA99003 ProsperoTV, PPSA99004 ProsperoAI, PPSA99008 ProsperoEden, PPSA99009 ProsperoLichess, PPSA99288 Nuvio Max'd, PPSA99773 PShare, PPSA99930 Forwarder Manager | Method: the 65 release archives listed in [ps5-homebrew-catalog](https://github.com/blackbearreloaded/ps5-homebrew-catalog) were downloaded (SHA-256 equal to the catalog records); 63 of them hold an `eboot.bin`, which was unwrapped from its fake-signed container. Nothing was run. Each call site of `setsockopt` and `getsockopt` was found through the import's GOT slot, and the level and option were read from the instructions before it (`objdump`). That recovers a value only where the compiler loads a constant right before the call: both were recovered at 840 of 2661 `setsockopt` call sites, so the counts are lower bounds. ### Tests <details><summary>Windows: guest_socket_stream_options, 20 repeated runs</summary> ```text Test project <build> Test #955: guest_socket_stream_options ...... Passed 0.06 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.02 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec Test #955: guest_socket_stream_options ...... Passed 0.03 sec 1/1 Test #955: guest_socket_stream_options ...... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 Total Test time (real) = 0.97 sec ``` </details> <details><summary>Windows: the nine socket tests (guest_udp times out on this machine with main's Udp.cpp too, see the control)</summary> ```text Test project <build> 1/9 Test #948: guest_socket_error ............... Passed 0.02 sec 2/9 Test #949: guest_udp ........................***Timeout 20.02 sec 3/9 Test #950: guest_socket_read_write .......... Passed 0.06 sec 4/9 Test #951: guest_poll ....................... Passed 0.25 sec 5/9 Test #952: guest_tcp ........................ Passed 0.06 sec 6/9 Test #953: guest_socket_pair ................ Passed 0.06 sec 7/9 Test #955: guest_socket_stream_options ...... Passed 0.03 sec 8/9 Test #957: guest_socket_descriptors ......... Passed 0.06 sec 9/9 Test #958: guest_socket_events .............. Passed 0.22 sec 89% tests passed, 1 tests failed out of 9 Total Test time (real) = 20.85 sec The following tests FAILED: 949 - guest_udp (Timeout) ``` </details> <details><summary>Windows control: Udp.cpp from main, new test</summary> ```text Test project <build> 1/2 Test #947: guest_udp ........................***Timeout 20.02 sec 2/2 Test #953: guest_socket_stream_options ......Exit code 0xc0000409***Exception: 0.24 sec socket stream option check failed at line 92, errno 42 0% tests passed, 2 tests failed out of 2 Total Test time (real) = 20.35 sec The following tests FAILED: 947 - guest_udp (Timeout) ``` </details> <details><summary>Linux: the ten socket tests</summary> ```text Test project <build> 1/10 Test #921: guest_socket_error ............... Passed 0.00 sec 2/10 Test #922: guest_udp ........................ Passed 0.01 sec 3/10 Test #923: guest_socket_read_write .......... Passed 0.05 sec 4/10 Test #924: guest_poll ....................... Passed 0.18 sec 5/10 Test #925: guest_select ..................... Passed 0.31 sec 6/10 Test #926: guest_tcp ........................ Passed 0.01 sec 7/10 Test #927: guest_socket_pair ................ Passed 0.01 sec 8/10 Test #929: guest_socket_stream_options ...... Passed 0.01 sec 9/10 Test #931: guest_socket_descriptors ......... Passed 0.01 sec 10/10 Test #932: guest_socket_events .............. Passed 0.15 sec 100% tests passed, 0 tests failed out of 10 Total Test time (real) = 0.78 sec ``` </details> <details><summary>Linux control: Udp.cpp from main, new test</summary> ```text Test project <build> 1/1 Test #927: guest_socket_stream_options ......Subprocess aborted***Exception: 0.01 sec socket stream option check failed at line 92, errno 42 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 0.03 sec The following tests FAILED: ``` </details> The two controls were run on `main` `bfc10637d`, before the rebase onto `d1670009f`; `Udp.cpp` and the test are the same on both. AI-assisted (Claude Code).
Dripl1x commented 2026-10-14 00:09:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-14T00:09:32Z.


The PR overlap check lists four open pull requests against this one, so the checklist declares the order Depends on: #4796, #4903, #4920, #5403. None is a functional prerequisite; this PR goes after them and is rebased when each lands. Trial git merge-tree results for head 36ff565fe:

  • @xXPBSXx #4796 (79e162110): conflict in Udp.cpp only, where this PR adds one line to setsockopt and one to getsockopt right before the lines yours replaces. Your PR is the base of this one in substance. After it lands the three options move into your SocketOptions.cpp, and the check in GuestSocketOptions.cpp that SO_NOSIGPIPE fails changes to this PR's behaviour: here the option is not only kept, on Linux it makes a send or write pass MSG_NOSIGNAL, which is what the review of #4796 asked for before accepting it.
  • @ErenYeager1836 #4903 (2cbec36e5), @xXPBSXx #4920 (2e553b97c) and @EagleBearerYS #5403 (ed2b2e5aa): conflict in docs/dev/debt/libkernel.md only. This PR corrects the sentence about SIGPIPE in the socket read and write entry, and yours add or edit the entries next to it. Keeping both sides resolves each.

If one of you prefers this PR first, say so and I drop that number from the line.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157880422 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#issuecomment-6157880422). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-14T00:09:32Z. --- The PR overlap check lists four open pull requests against this one, so the checklist declares the order `Depends on: #4796, #4903, #4920, #5403`. None is a functional prerequisite; this PR goes after them and is rebased when each lands. Trial `git merge-tree` results for head `36ff565fe`: - @xXPBSXx #4796 (`79e162110`): conflict in `Udp.cpp` only, where this PR adds one line to `setsockopt` and one to `getsockopt` right before the lines yours replaces. Your PR is the base of this one in substance. After it lands the three options move into your `SocketOptions.cpp`, and the check in `GuestSocketOptions.cpp` that `SO_NOSIGPIPE` fails changes to this PR's behaviour: here the option is not only kept, on Linux it makes a send or write pass `MSG_NOSIGNAL`, which is what the review of #4796 asked for before accepting it. - @ErenYeager1836 #4903 (`2cbec36e5`), @xXPBSXx #4920 (`2e553b97c`) and @EagleBearerYS #5403 (`ed2b2e5aa`): conflict in `docs/dev/debt/libkernel.md` only. This PR corrects the sentence about `SIGPIPE` in the socket read and write entry, and yours add or edit the entries next to it. Keeping both sides resolves each. If one of you prefers this PR first, say so and I drop that number from the line. AI-assisted (Claude Code).
adriadam10 commented 2026-10-14 12:12:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T12:12:04Z.

Review: CHANGES_REQUESTED


#4796 is merged, so this needs a rebase and a port before it can land:

  • setsockopt/getsockopt on main now delegate to GuestSockets::SetSocketLevelOption/GetSocketLevelOption in Socket/src/SocketOptions.cpp, with the per-socket state in Socket::options under modeMutex (Udp.cpp setsockopt_nid_postfix). Udp.cpp conflicts on exactly those lines. Please move SO_NOSIGPIPE, SO_NBIO and the IPPROTO_TCP handling into that structure (the SO_NOSIGPIPE flag belongs in SocketOptionState, not a separate atomic read outside the lock) instead of a second dispatcher in front of it.
  • core/libs/tests/GuestSocketOptions.cpp:155 on main expects SO_NOSIGPIPE (0x800) to fail; it has to change with this behaviour, and your new test should keep passing next to it.
  • Keep the accept inheritance and the MSG_NOSIGNAL on send/sendto/write; those parts look right against kern_sendit/sonewconn.
  • Docs: docs/dev/debt/libkernel.md conflicts with main; "Depends on: #4796, #4903, #4920, #5403" no longer matches (#4796 and #4903 merged, #4920 and #5403 closed). Update it to what is actually open.

Once it is rebased on current main with guest_socket_stream_options and guest_socket_options passing, it should be ready for another look.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5517658009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#pullrequestreview-5517658009). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T12:12:04Z. **Review:** CHANGES_REQUESTED --- #4796 is merged, so this needs a rebase and a port before it can land: - `setsockopt`/`getsockopt` on main now delegate to `GuestSockets::SetSocketLevelOption`/`GetSocketLevelOption` in `Socket/src/SocketOptions.cpp`, with the per-socket state in `Socket::options` under `modeMutex` (`Udp.cpp` `setsockopt_nid_postfix`). `Udp.cpp` conflicts on exactly those lines. Please move `SO_NOSIGPIPE`, `SO_NBIO` and the `IPPROTO_TCP` handling into that structure (the `SO_NOSIGPIPE` flag belongs in `SocketOptionState`, not a separate atomic read outside the lock) instead of a second dispatcher in front of it. - `core/libs/tests/GuestSocketOptions.cpp:155` on main expects `SO_NOSIGPIPE` (`0x800`) to fail; it has to change with this behaviour, and your new test should keep passing next to it. - Keep the `accept` inheritance and the `MSG_NOSIGNAL` on `send`/`sendto`/`write`; those parts look right against `kern_sendit`/`sonewconn`. - Docs: `docs/dev/debt/libkernel.md` conflicts with main; "Depends on: #4796, #4903, #4920, #5403" no longer matches (#4796 and #4903 merged, #4920 and #5403 closed). Update it to what is actually open. Once it is rebased on current main with `guest_socket_stream_options` and `guest_socket_options` passing, it should be ready for another look.
Dripl1x commented 2026-10-14 15:32:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-14T15:32:28Z.


@adriadam10 ported to main 84b01f9cd as you described. It is one commit, 1e4783573:

  • SO_NOSIGPIPE and SO_NBIO are handled in SetSocketLevelOption and GetSocketLevelOption. TCP_NODELAY is in new SetTcpLevelOption and GetTcpLevelOption in SocketOptions.cpp. setsockopt and getsockopt pick the function by level, SOL_SOCKET or 6, under modeMutex. The OwnOption/SetOwnOption/GetOwnOption dispatcher is gone.
  • noSignal is a field of SocketOptionState, and send and sendto read it under modeMutex; sendmsg and write go through them. nonblocking moved from Socket into SocketOptionState too, so SO_NBIO, fcntl, ioctl(FIONBIO) and accept share one flag.
  • accept copies noSignal in the same locked block that reads the listener's nonblocking. MSG_NOSIGNAL on send/sendto is unchanged.
  • GuestSocketOptions.cpp: SO_NOSIGPIPE is now checked to read back as its bit. The other four options in that loop still fail with ENOPROTOOPT.
  • The three options use the file's existing argument checks, so a null value is EINVAL. My first version returned EFAULT there, after kern_setsockopt; the debt entry now records that difference for every option.
  • Docs: the SocketOptions.cpp debt entry and the SIGPIPE sentence of the socket read/write entry are updated. Depends on now lists only #5020, which changes the lines next to the F_GETFL line this PR touches. #4796 and #4903 are merged, and #4920 and #5403 are closed.

Results at 1e4783573:

  • Windows: guest_socket_stream_options and guest_socket_options pass 20 of 20 repeated runs, and 11 of the 12 socket tests pass. guest_udp times out here on main too, because a VPN on this machine drops IPv6 loopback traffic: a datagram to [::1] never arrives, even between two plain host sockets.
  • Linux: all 12 socket tests pass, guest_udp included.
  • Control: with SocketOptions.hpp, SocketOptions.cpp and Udp.cpp from main, both tests fail on both systems. guest_socket_stream_options stops at line 91, errno 42, and guest_socket_options with setsockopt of an integer option failed (errno 42).

#5617 is rebased onto this commit.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172013532 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#issuecomment-6172013532). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-14T15:32:28Z. --- @adriadam10 ported to `main` `84b01f9cd` as you described. It is one commit, `1e4783573`: - `SO_NOSIGPIPE` and `SO_NBIO` are handled in `SetSocketLevelOption` and `GetSocketLevelOption`. `TCP_NODELAY` is in new `SetTcpLevelOption` and `GetTcpLevelOption` in `SocketOptions.cpp`. `setsockopt` and `getsockopt` pick the function by level, SOL_SOCKET or 6, under `modeMutex`. The `OwnOption`/`SetOwnOption`/`GetOwnOption` dispatcher is gone. - `noSignal` is a field of `SocketOptionState`, and `send` and `sendto` read it under `modeMutex`; `sendmsg` and `write` go through them. `nonblocking` moved from `Socket` into `SocketOptionState` too, so `SO_NBIO`, `fcntl`, `ioctl(FIONBIO)` and `accept` share one flag. - `accept` copies `noSignal` in the same locked block that reads the listener's `nonblocking`. `MSG_NOSIGNAL` on `send`/`sendto` is unchanged. - `GuestSocketOptions.cpp`: `SO_NOSIGPIPE` is now checked to read back as its bit. The other four options in that loop still fail with `ENOPROTOOPT`. - The three options use the file's existing argument checks, so a null value is `EINVAL`. My first version returned `EFAULT` there, after `kern_setsockopt`; the debt entry now records that difference for every option. - Docs: the `SocketOptions.cpp` debt entry and the `SIGPIPE` sentence of the socket read/write entry are updated. `Depends on` now lists only #5020, which changes the lines next to the `F_GETFL` line this PR touches. #4796 and #4903 are merged, and #4920 and #5403 are closed. Results at `1e4783573`: - Windows: `guest_socket_stream_options` and `guest_socket_options` pass 20 of 20 repeated runs, and 11 of the 12 socket tests pass. `guest_udp` times out here on `main` too, because a VPN on this machine drops IPv6 loopback traffic: a datagram to `[::1]` never arrives, even between two plain host sockets. - Linux: all 12 socket tests pass, `guest_udp` included. - Control: with `SocketOptions.hpp`, `SocketOptions.cpp` and `Udp.cpp` from `main`, both tests fail on both systems. `guest_socket_stream_options` stops at `line 91, errno 42`, and `guest_socket_options` with `setsockopt of an integer option failed (errno 42)`. #5617 is rebased onto this commit. AI-assisted (Claude Code).
adriadam10 commented 2026-10-15 11:17:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T11:17:30Z.

Review: APPROVED


Re-checked on the current head, merged onto main:

  • Ported into SocketOptionState under modeMutex; no second dispatcher in Udp.cpp.
  • guest_socket_options updated for SO_NOSIGPIPE; guest_socket_options and guest_socket_stream_options pass, and both fail with the SocketOptions/Udp.cpp changes reverted.
  • accept inheritance and MSG_NOSIGNAL on send/sendto/write kept; debt doc matches what is open.

Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5532241443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#pullrequestreview-5532241443). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T11:17:30Z. **Review:** APPROVED --- Re-checked on the current head, merged onto main: - Ported into `SocketOptionState` under `modeMutex`; no second dispatcher in `Udp.cpp`. - `guest_socket_options` updated for `SO_NOSIGPIPE`; `guest_socket_options` and `guest_socket_stream_options` pass, and both fail with the `SocketOptions`/`Udp.cpp` changes reverted. - `accept` inheritance and `MSG_NOSIGNAL` on `send`/`sendto`/`write` kept; debt doc matches what is open. Merging once the full Build is green.
github-actions[bot] commented 2026-10-15 12:08:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:08:03Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
#3891 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4156 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4396 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4397 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4422 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4423 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4424 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4520 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4521 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4522 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4523 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4566 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4599 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4718 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4740 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4749 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4760 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4813 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#4972 core/libs/prx/libkernel/CMakeLists.txt
#5021 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#6044 core/libs/prx/libkernel/CMakeLists.txt
core/libs/tests/GuestSocketOptions.cpp
#6222 core/libs/prx/libkernel/CMakeLists.txt
core/libs/prx/libkernel/Socket/src/Udp.cpp
docs/dev/debt/libkernel.md
#6226 core/libs/prx/libkernel/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191676223 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#issuecomment-6191676223). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:08:03Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | #3891 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4156 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4396 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4397 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4422 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4423 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4424 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4520 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4521 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4522 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4523 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4566 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4599 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4718 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4740 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4749 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4760 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4813 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #4972 | `core/libs/prx/libkernel/CMakeLists.txt` | | #5021 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #6044 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/tests/GuestSocketOptions.cpp` | | #6222 | `core/libs/prx/libkernel/CMakeLists.txt`<br>`core/libs/prx/libkernel/Socket/src/Udp.cpp`<br>`docs/dev/debt/libkernel.md` | | #6226 | `core/libs/prx/libkernel/CMakeLists.txt` |
screamm commented 2026-10-15 14:13:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-15T14:13:18Z.


Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head 7e79f36ed merged on main b08db6a09:

This ran after the merge (1036905b5), so it is a post-merge confirmation. "Before" is main 8856f180c (before the merge) and, as a clean control, b08db6a09 with only SocketOptions.hpp, SocketOptions.cpp and Udp.cpp from 1036905b5^1. Catalog releases, app0/eboot.bin staged, relinker --windows --registry unused-filter=0, display on, 90 s per run. The host was busy with other builds, so frame counts follow load. To see the calls I wrapped libkernel setsockopt/getsockopt in a local stderr trace (not part of any PR).

ProsperoRadio (PPSA99001)

  • 8856f180c: running at 90 s, ProsperoRadio | FPS: 9.68 (1519), title log [ProsperoRadio][http] non-blocking sockets: NOT set.
  • Reverted control, traced: ProsperoRadio | FPS: 18.99 (1907). 16 curl sockets, each with setsockopt(fd, 0x6, 0x1, 1) = -1 errno 42, setsockopt(fd, 0xffff, 0x800, 1) = -1 errno 42 and setsockopt(fd, 0xffff, 0x1200, 1) = -1 errno 42; non-blocking sockets: NOT set.
  • b08db6a09, run 1: ProsperoRadio | FPS: 59.95 (4932), [ProsperoRadio][http] non-blocking sockets: set.
  • b08db6a09, run 2 (traced): ProsperoRadio | FPS: 35.48 (493). The same 16 sockets, now TCP_NODELAY, SO_NOSIGPIPE and SO_NBIO each = 0, and getsockopt(fd, 0xffff, 0x1007) = 0 value 0; non-blocking sockets: set.
  • Requests still end in curl 77 on /<sandbox>/common/cert/CA_LIST.cer with every build. That is a separate gap.

VITA5 (PPSA39410)

  • 8856f180c: running at 90 s, VITA5 PPSA17035 | FPS: 57.36 (3198).
  • Reverted control, traced (FPS: 49.00 (3670)): 30 IPC sockets, each stopping at setsockopt(fd, 0xffff, 0x1200, 1) = -1 errno 42, because configure_socket returns there.
  • b08db6a09, run 1: FPS: 30.24 (2952).
  • b08db6a09, run 2 (traced, FPS: 45.96 (3669)): 31 sockets with 0x1200, TCP_NODELAY, SO_SNDBUF 65536 and SO_RCVBUF 262144, all = 0.
  • [VD5] dock attached=0 vita=0 in all runs; no Vita is attached here.

ProsperoStore (PPSA99000)

  • 8856f180c: ProsperoStore | FPS: 17.17 (1267). b08db6a09: FPS: 15.74 (1007) and FPS: 11.25 (629).
  • All runs are still running at 90 s. The trace shows no libkernel setsockopt call: on this host it logs [STORE] transport elevated=1 ca_list=0 -> sceHttp and fails through sceHttp (http rc=0x80431063 ... The network request failed), so the native-curl SO_NBIO callback is not reached.

No run had a stop line.

Tests

  • guest_socket_options and guest_socket_stream_options pass 3/3 (--repeat until-fail:3), on b08db6a09 and with #5617 on top.
  • Negative control (the three source files from 1036905b5^1, tests kept): both fail as in the description, with setsockopt of an integer option failed (errno 42) and socket stream option check failed at line 91, errno 42.

Suite. ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip' on this tree with #5617 merged: 825 tests, 16 failed under host load. 14 of the 16 pass when rerun serially. prx_thread_local_destructors reports the libSceAgcDriver traceDrawKeyLookup thread_local, which #6349 fixes after b08db6a09. hardware_oracle_compare hits its 20 s limit under load.

Conventions. tools/check_conventions.py with title and description passes. git diff --check is clean.

Review. The FreeBSD links are pinned to 8c639945a (the release/11.4.0 commit), and the cited lines match: TF_NODELAY read back as 4, so_options & SO_NOSIGPIPE, EINVAL from sooptcopyin and from ip_ctloutput/uipc_ctloutput for the TCP level on UDP and AF_UNIX, and ENOPROTOOPT for the other TCP options. The TCP option is mapped through the host's IPPROTO_TCP/TCP_NODELAY rather than passed through. Storing SO_NOSIGPIPE without effect on Windows is exact, since Winsock raises no signal. SO_NBIO shares the non-blocking flag with fcntl, ioctl(FIONBIO) and accept under modeMutex. No concerns.

Written with Claude Code assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6194172842 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5565#issuecomment-6194172842). Originally posted by [screamm](https://github.com/screamm) on 2026-10-15T14:13:18Z. --- Cross-validation on Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), MinGW GCC 15.2, PR head `7e79f36ed` merged on main `b08db6a09`: This ran after the merge (`1036905b5`), so it is a post-merge confirmation. "Before" is main `8856f180c` (before the merge) and, as a clean control, `b08db6a09` with only `SocketOptions.hpp`, `SocketOptions.cpp` and `Udp.cpp` from `1036905b5^1`. Catalog releases, `app0/eboot.bin` staged, `relinker --windows --registry unused-filter=0`, display on, 90 s per run. The host was busy with other builds, so frame counts follow load. To see the calls I wrapped libkernel `setsockopt`/`getsockopt` in a local stderr trace (not part of any PR). **ProsperoRadio (PPSA99001)** - `8856f180c`: running at 90 s, `ProsperoRadio | FPS: 9.68 (1519)`, title log `[ProsperoRadio][http] non-blocking sockets: NOT set`. - Reverted control, traced: `ProsperoRadio | FPS: 18.99 (1907)`. 16 curl sockets, each with `setsockopt(fd, 0x6, 0x1, 1) = -1 errno 42`, `setsockopt(fd, 0xffff, 0x800, 1) = -1 errno 42` and `setsockopt(fd, 0xffff, 0x1200, 1) = -1 errno 42`; `non-blocking sockets: NOT set`. - `b08db6a09`, run 1: `ProsperoRadio | FPS: 59.95 (4932)`, `[ProsperoRadio][http] non-blocking sockets: set`. - `b08db6a09`, run 2 (traced): `ProsperoRadio | FPS: 35.48 (493)`. The same 16 sockets, now `TCP_NODELAY`, `SO_NOSIGPIPE` and `SO_NBIO` each `= 0`, and `getsockopt(fd, 0xffff, 0x1007) = 0 value 0`; `non-blocking sockets: set`. - Requests still end in curl 77 on `/<sandbox>/common/cert/CA_LIST.cer` with every build. That is a separate gap. **VITA5 (PPSA39410)** - `8856f180c`: running at 90 s, `VITA5 PPSA17035 | FPS: 57.36 (3198)`. - Reverted control, traced (`FPS: 49.00 (3670)`): 30 IPC sockets, each stopping at `setsockopt(fd, 0xffff, 0x1200, 1) = -1 errno 42`, because `configure_socket` returns there. - `b08db6a09`, run 1: `FPS: 30.24 (2952)`. - `b08db6a09`, run 2 (traced, `FPS: 45.96 (3669)`): 31 sockets with `0x1200`, `TCP_NODELAY`, `SO_SNDBUF 65536` and `SO_RCVBUF 262144`, all `= 0`. - `[VD5] dock attached=0 vita=0` in all runs; no Vita is attached here. **ProsperoStore (PPSA99000)** - `8856f180c`: `ProsperoStore | FPS: 17.17 (1267)`. `b08db6a09`: `FPS: 15.74 (1007)` and `FPS: 11.25 (629)`. - All runs are still running at 90 s. The trace shows no libkernel `setsockopt` call: on this host it logs `[STORE] transport elevated=1 ca_list=0 -> sceHttp` and fails through sceHttp (`http rc=0x80431063 ... The network request failed`), so the native-curl `SO_NBIO` callback is not reached. No run had a stop line. **Tests** - `guest_socket_options` and `guest_socket_stream_options` pass 3/3 (`--repeat until-fail:3`), on `b08db6a09` and with #5617 on top. - Negative control (the three source files from `1036905b5^1`, tests kept): both fail as in the description, with `setsockopt of an integer option failed (errno 42)` and `socket stream option check failed at line 91, errno 42`. **Suite.** `ctest -j8 --timeout 120 -E '^agc_driver_|^video_out_flip'` on this tree with #5617 merged: 825 tests, 16 failed under host load. 14 of the 16 pass when rerun serially. `prx_thread_local_destructors` reports the libSceAgcDriver `traceDrawKeyLookup` thread_local, which #6349 fixes after `b08db6a09`. `hardware_oracle_compare` hits its 20 s limit under load. **Conventions.** `tools/check_conventions.py` with title and description passes. `git diff --check` is clean. **Review.** The FreeBSD links are pinned to `8c639945a` (the `release/11.4.0` commit), and the cited lines match: `TF_NODELAY` read back as 4, `so_options & SO_NOSIGPIPE`, `EINVAL` from `sooptcopyin` and from `ip_ctloutput`/`uipc_ctloutput` for the TCP level on UDP and AF_UNIX, and `ENOPROTOOPT` for the other TCP options. The TCP option is mapped through the host's `IPPROTO_TCP`/`TCP_NODELAY` rather than passed through. Storing `SO_NOSIGPIPE` without effect on Windows is exact, since Winsock raises no signal. `SO_NBIO` shares the non-blocking flag with `fcntl`, `ioctl(FIONBIO)` and `accept` under `modeMutex`. No concerns. Written with Claude Code assistance.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5565
No description provided.