Windows: a send after shutdown(SHUT_WR) fails with EIO instead of EPIPE #1785

Closed
opened 2026-10-08 19:10:01 +00:00 by Zurisen · 0 comments
Zurisen commented 2026-10-08 19:10:01 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Zurisen on 2026-10-08T19:10:01Z.


On main (55e8959b), sending on a socket that was shut down for writing fails with errno 5 (EIO) on Windows. FreeBSD send(2) fails with EPIPE (32) there, and Linux already reports 32. Not specific to one title.

Winsock fails send/sendto after shutdown(SD_SEND) or shutdown(SD_BOTH) with WSAESHUTDOWN (10058). Neither Windows error map handles it, so it falls to default: return 5:

  • libkernel NativeError (Udp.cpp): send, sendto, sendmsg
  • libSceNet native_error (Export.cpp): sceNetSend, sceNetSendto, sceNetSendmsg

The Linux branches of both maps translate the host's EPIPE to 32.

Reproduced on Windows 11 (10.0.26200), MinGW-w64 GCC 15.2.0, on a loopback TCP pair: shutdown(client, 1) then send(client, ...) returns -1 with errno 5; sceNetShutdown(client, 1) then sceNetSend(client, ...) returns 0x80410105.

Fixed in #1786.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5767465673 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/1785). Originally posted by [Zurisen](https://github.com/Zurisen) on 2026-10-08T19:10:01Z. --- On main (`55e8959b`), sending on a socket that was shut down for writing fails with errno 5 (`EIO`) on Windows. FreeBSD `send(2)` fails with `EPIPE` (32) there, and Linux already reports 32. Not specific to one title. Winsock fails `send`/`sendto` after `shutdown(SD_SEND)` or `shutdown(SD_BOTH)` with `WSAESHUTDOWN` (10058). Neither Windows error map handles it, so it falls to `default: return 5`: - libkernel `NativeError` ([Udp.cpp](https://github.com/boykopovar/AnyPS5/blob/55e8959b/core/libs/prx/libkernel/Socket/src/Udp.cpp#L50-L70)): `send`, `sendto`, `sendmsg` - libSceNet `native_error` ([Export.cpp](https://github.com/boykopovar/AnyPS5/blob/55e8959b/core/libs/prx/libSceNet/Export.cpp#L93-L116)): `sceNetSend`, `sceNetSendto`, `sceNetSendmsg` The Linux branches of both maps translate the host's `EPIPE` to 32. Reproduced on Windows 11 (10.0.26200), MinGW-w64 GCC 15.2.0, on a loopback TCP pair: `shutdown(client, 1)` then `send(client, ...)` returns -1 with errno 5; `sceNetShutdown(client, 1)` then `sceNetSend(client, ...)` returns `0x80410105`. Fixed in #1786.
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#1785
No description provided.