From 4583977ce01080c00daf3fea70c0fe4a61fc7188 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Thu, 18 Jun 2026 17:26:09 +0900 Subject: [PATCH] lib/net: export sockaddrin for sep export-hygiene (M4 E3, #102) connect/bind export `*sockaddrin`, so under --sep the .wwi producer's check_exported_type (both stages, correctly) rejects an exported decl referencing the unexported type. Invisible on the old combined path (net inlined, fed to w6c without -I). Hare exports sockaddr_in (ref/hare/sys/+linux/socket.ha:11) and lib/net plays Hare's sys role, so the caller must be able to name it. Same class as #48. No codegen change (export is a checker property); byte-id holds. --- lib/net/net.ww | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/net/net.ww b/lib/net/net.ww index 3336d8e4..449684ac 100644 --- a/lib/net/net.ww +++ b/lib/net/net.ww @@ -20,7 +20,9 @@ def SYS_LISTEN: i64 = 50; // sockaddrin is laid out by the kernel: family u16, port u16 (BE), // addr u32 (BE), padding 8B = 16B total. Caller fills it. -type sockaddrin = struct { +// Exported: connect/bind take *sockaddrin, so a caller must be able to +// name it (Hare exports sockaddr_in; ref/hare/sys/+linux/socket.ha:11). #102 +export type sockaddrin = struct { family: u16, port: u16, addr: u32,