authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-19 14:50:04-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-23 22:15:11-08:00
log6aa31cedb7b5461c06d43b813d70ab6c21375cce
tree86c0a314dea2b6d14e30c74be2e04d7073f96783
parent3e624e17a40fd65b68dbec45030280008c6b4018

std.Io.Dir.Reader: fix min_buffer_len on 32-bit linux

dirents64 still uses 8 byte alignment on 32-bit systems

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

lib/std/Io/Dir.zig+2-2
...@@ -103,8 +103,8 @@ pub const Reader = struct {...@@ -103,8 +103,8 @@ pub const Reader = struct {
103103
104 /// A length for `buffer` that allows all implementations to function.104 /// A length for `buffer` that allows all implementations to function.
105 pub const min_buffer_len = switch (native_os) {105 pub const min_buffer_len = switch (native_os) {
106 .linux => @sizeOf(std.os.linux.dirent64) +106 .linux => std.mem.alignForward(usize, @sizeOf(std.os.linux.dirent64), 8) +
107 std.mem.alignForward(usize, max_name_bytes, @alignOf(std.os.linux.dirent64)),107 std.mem.alignForward(usize, max_name_bytes, 8),
108 .windows => std.mem.alignForward(usize, max_name_bytes, @alignOf(usize)),108 .windows => std.mem.alignForward(usize, max_name_bytes, @alignOf(usize)),
109 else => if (builtin.link_libc) @sizeOf(std.c.dirent) else std.mem.alignForward(usize, max_name_bytes, @alignOf(usize)),109 else => if (builtin.link_libc) @sizeOf(std.c.dirent) else std.mem.alignForward(usize, max_name_bytes, @alignOf(usize)),
110 };110 };