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:
agra
2026-06-12 20:53:35 +03:00
parent da2f76b383
commit 659c43c8d6
78 changed files with 52988 additions and 47974 deletions

View 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