libkernel: send/recv with MSG_DONTWAIT fail with EOPNOTSUPP on Windows #8185

Closed
opened 2026-10-20 01:52:02 +00:00 by xXPBSXx · 0 comments
xXPBSXx commented 2026-10-20 01:52:02 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T01:52:02Z.


Repro

Windows host. Bound UDP socket, nothing queued: recv(s, buf, n, 0x80) (also recvfrom, recvmsg, sendto/send with 0x80).
Expected (FreeBSD 11.4 soreceive_generic/sosend_generic, sys/kern/uipc_socket.c, MSG_DONTWAIT): the call does not wait: EWOULDBLOCK (35) when nothing can be transferred.
Actual: EOPNOTSUPP (45) on Windows (GuestReceiveFlags accepts only MSG_PEEK there); Linux/macOS pass the flag to the host. Documented in docs/dev/debt/libkernel.md (MSG_DONTWAIT entry).
Test: core/libs/tests/GuestUdp.cpp, GuestSocketTimeouts.cpp (the Windows branches asserted EOPNOTSUPP; they now run the checks of the other hosts).
Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/socket-dontwait-windows-fb
AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5934525383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8185). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-20T01:52:02Z. --- ### Repro Windows host. Bound UDP socket, nothing queued: `recv(s, buf, n, 0x80)` (also `recvfrom`, `recvmsg`, `sendto`/`send` with 0x80). Expected (FreeBSD 11.4 `soreceive_generic`/`sosend_generic`, sys/kern/uipc_socket.c, MSG_DONTWAIT): the call does not wait: EWOULDBLOCK (35) when nothing can be transferred. Actual: EOPNOTSUPP (45) on Windows (`GuestReceiveFlags` accepts only MSG_PEEK there); Linux/macOS pass the flag to the host. Documented in docs/dev/debt/libkernel.md (MSG_DONTWAIT entry). Test: `core/libs/tests/GuestUdp.cpp`, `GuestSocketTimeouts.cpp` (the Windows branches asserted EOPNOTSUPP; they now run the checks of the other hosts). Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/socket-dontwait-windows-fb AI-assisted (Claude Code).
Sign in to join this conversation.
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#8185
No description provided.