From c5d23161fcadf06089656b1f1d0fb725d7217b74 Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Fri, 14 Oct 2022 00:23:00 -0700 Subject: [PATCH] Set wasi MAX_NAME_BYTES to minimum of the rest of the supported platforms This is a slightly weird situation, because the 'real' value may depend on the host platform that the WASI is being executed on. --- lib/std/fs.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/fs.zig b/lib/std/fs.zig index 8fedfd75b3..d14f29f841 100644 --- a/lib/std/fs.zig +++ b/lib/std/fs.zig @@ -60,7 +60,7 @@ pub const MAX_NAME_BYTES = switch (builtin.os.tag) { // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. .windows => os.windows.NAME_MAX * 3, // TODO work out what a reasonable value we should use here - .wasi => 1024, + .wasi => 255, else => if (@hasDecl(root, "os") and @hasDecl(root.os, "NAME_MAX")) root.os.NAME_MAX else