feat: std.socket nonblocking surface — fcntl, errno, typed _nb wrappers (PLAN-HTTPZ S2)
set_nonblocking (C-variadic fcntl), errno via __error (darwin; C3 selects per-OS), and accept_nb/read_nb/write_nb returning a typed SockErr — WouldBlock / Closed / Fault — so readiness-loop callers never parse -1/errno pairs. EINTR retries internally; accept_nb skips ECONNABORTED. Adds connect, shutdown, socketpair, AF_UNIX, SHUT_*. examples/1630 pins the result algebra on a socketpair and a nonblocking TCP listener (WouldBlock on empty backlog, accept after loopback connect); verified under sx run AND sx build. The .ir snapshot regen is mechanical: new std decls shift @str/@tag.str numbering and grow the type table (179 -> 185).
This commit is contained in:
6
examples/expected/1630-socket-nonblocking.stdout
Normal file
6
examples/expected/1630-socket-nonblocking.stdout
Normal file
@@ -0,0 +1,6 @@
|
||||
empty read: WouldBlock
|
||||
pair round trip: 4 bytes
|
||||
peer close: Closed
|
||||
empty backlog: WouldBlock
|
||||
accept after connect: ok
|
||||
socket nonblocking ok
|
||||
Reference in New Issue
Block a user