From 12d78be492351e29144daa379232bbd955b47631 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 02:53:19 -0300 Subject: 9ns: a server's "too many open files" reaches the caller as EMFILE, not EIO pardes refuses an open past its 64 open records in those words, and 9ns, matching no needle, gave the shell Input/output error, which says nothing of a limit. The words now map to EMFILE, "Too many open files". Co-Authored-By: Claude Opus 5.5 --- 9ns/src/nine.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/9ns/src/nine.zig b/9ns/src/nine.zig index c7abbe6..0dc957c 100644 --- a/9ns/src/nine.zig +++ b/9ns/src/nine.zig @@ -971,6 +971,9 @@ pub fn enameToErrno(ename: []const u8) linux.E { .{ .needle = "busy", .err = .BUSY }, .{ .needle = "in use", .err = .BUSY }, .{ .needle = "too long", .err = .NAMETOOLONG }, + // A server's open records all taken (pardes: 64): the fd table's + // word, which a shell prints as "Too many open files". + .{ .needle = "too many open files", .err = .MFILE }, .{ .needle = "not supported", .err = .OPNOTSUPP }, .{ .needle = "unsupported", .err = .OPNOTSUPP }, }; @@ -1075,6 +1078,7 @@ test "ename → errno mapping" { try testing.expectEqual(linux.E.IO, enameToErrno("window shut down")); try testing.expectEqual(linux.E.NOENT, enameToErrno("file does not exist")); try testing.expectEqual(linux.E.NOENT, enameToErrno("No Such File")); + try testing.expectEqual(linux.E.MFILE, enameToErrno("too many open files")); try testing.expectEqual(linux.E.NOENT, enameToErrno("directory entry not found")); try testing.expectEqual(linux.E.EXIST, enameToErrno("file already exists")); try testing.expectEqual(linux.E.NOTEMPTY, enameToErrno("directory not empty")); -- cgit v1.3