Files
RedBear-OS/netstack
Red Bear OS cf21752385 tcp: override SchemeSocket::call to implement SocketCall::SendMsg + MSG_NOSIGNAL
Adds a call() override for TcpSocket that handles SocketCall::SendMsg.
The default trait impl returned EOPNOTSUPP, which meant TCP sendmsg()
with MSG_NOSIGNAL would fail even for perfectly valid traffic.

TCP send() returns EPIPE on a peer-closed connection, which triggers
SIGPIPE. MSG_NOSIGNAL emulation:
1. Block SIGPIPE for the duration of send_slice()
2. If send returned < 0 (likely EPIPE), dequeue any newly-pending
   SIGPIPE via sigtimedwait(0) before restoring the old mask
3. Restore the caller's signal mask
4. If pthread_sigmask failed, fall through to plain send
2026-07-27 20:39:16 +09:00
..