authorgravatar for ryan@zinascii.comRyan Zezeski <ryan@zinascii.com> 2023-09-26 16:03:21-06:00
committergravatar for ryan@zinascii.comRyan Zezeski <ryan@zinascii.com> 2023-09-30 11:38:56-06:00
logc17ebdca6afef9523a69caeaea090cd537d71945
tree4b7ab7479cc2fc7f4aa9af13655c4f7d6091727e
parenta0ed2c69b06a55d86b9ca98314f31bd70058e3f8

solaris: fix path component max


2 files changed, 2 insertions(+), 2 deletions(-)

lib/std/c/solaris.zig+1
......@@ -498,6 +498,7 @@ pub const NI = struct {
498498 pub const MAXSERV = 32;
499499};
500500
501pub const NAME_MAX = 255;
501502pub const PATH_MAX = 1024;
502503pub const IOV_MAX = 1024;
503504
lib/std/fs.zig+1-2
......@@ -59,10 +59,9 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) {
5959/// (depending on the platform) this assumption may not hold for every configuration.
6060/// The byte count does not include a null sentinel byte.
6161pub const MAX_NAME_BYTES = switch (builtin.os.tag) {
62 .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly => os.NAME_MAX,
62 .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .solaris => os.NAME_MAX,
6363 // Haiku's NAME_MAX includes the null terminator, so subtract one.
6464 .haiku => os.NAME_MAX - 1,
65 .solaris => os.system.MAXNAMLEN,
6665 // Each UTF-16LE character may be expanded to 3 UTF-8 bytes.
6766 // If it would require 4 UTF-8 bytes, then there would be a surrogate
6867 // pair in the UTF-16LE, and we (over)account 3 bytes for it that way.