mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.Io.Dir.Reader: fix min_buffer_len on 32-bit linux
dirents64 still uses 8 byte alignment on 32-bit systems
This commit is contained in:
+2
-2
@@ -103,8 +103,8 @@ pub const Reader = struct {
|
||||
|
||||
/// A length for `buffer` that allows all implementations to function.
|
||||
pub const min_buffer_len = switch (native_os) {
|
||||
.linux => @sizeOf(std.os.linux.dirent64) +
|
||||
std.mem.alignForward(usize, max_name_bytes, @alignOf(std.os.linux.dirent64)),
|
||||
.linux => std.mem.alignForward(usize, @sizeOf(std.os.linux.dirent64), 8) +
|
||||
std.mem.alignForward(usize, max_name_bytes, 8),
|
||||
.windows => std.mem.alignForward(usize, max_name_bytes, @alignOf(usize)),
|
||||
else => if (builtin.link_libc) @sizeOf(std.c.dirent) else std.mem.alignForward(usize, max_name_bytes, @alignOf(usize)),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user