summaryrefslogtreecommitdiff
path: root/9ns/src/nine.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 02:53:19 -0300
committerGabriel Schneider <[email protected]>2026-10-01 02:53:19 -0300
commit12d78be492351e29144daa379232bbd955b47631 (patch)
tree0b83b0262d435d761b202ae604141c22194cc16f /9ns/src/nine.zig
parenta03d1649108510cda5951e918e561d7cae43d6b0 (diff)
downloadcloud9-12d78be492351e29144daa379232bbd955b47631.tar.gz
cloud9-12d78be492351e29144daa379232bbd955b47631.zip
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 <[email protected]>
Diffstat (limited to '9ns/src/nine.zig')
-rw-r--r--9ns/src/nine.zig4
1 files changed, 4 insertions, 0 deletions
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"));