Meghan Denny
2026-04-18 07:34:32 +02:00
committed by Andrew Kelley
parent 21914c7c01
commit 9636d76b6d
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -5484,7 +5484,7 @@ fn dirReadLinux(userdata: ?*anyopaque, dr: *Dir.Reader, buffer: []Dir.Entry) Dir
}
const syscall: Syscall = try .start();
const n = while (true) {
const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, dr.buffer.len);
const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, @min(dr.buffer.len, std.math.maxInt(c_uint)));
switch (linux.errno(rc)) {
.SUCCESS => {
syscall.finish();
+1 -1
View File
@@ -3070,7 +3070,7 @@ fn dirRead(userdata: ?*anyopaque, dr: *Dir.Reader, buffer: []Dir.Entry) Dir.Read
}
const n = while (true) {
try sync.cancel_region.await(.nothing);
const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, dr.buffer.len);
const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, @min(dr.buffer.len, std.math.maxInt(c_uint)));
switch (linux.errno(rc)) {
.SUCCESS => break rc,
.INTR => {},
+4 -4
View File
@@ -887,21 +887,21 @@ pub fn getcwd(buf: [*]u8, size: usize) usize {
return syscall2(.getcwd, @intFromPtr(buf), size);
}
pub fn getdents(fd: fd_t, dirp: [*]u8, len: usize) usize {
pub fn getdents(fd: fd_t, dirp: [*]u8, len: c_uint) usize {
return syscall3(
.getdents,
@as(u32, @bitCast(fd)),
@intFromPtr(dirp),
@min(len, maxInt(c_int)),
len,
);
}
pub fn getdents64(fd: fd_t, dirp: [*]u8, len: usize) usize {
pub fn getdents64(fd: fd_t, dirp: [*]u8, len: c_uint) usize {
return syscall3(
.getdents64,
@as(u32, @bitCast(fd)),
@intFromPtr(dirp),
@min(len, maxInt(c_int)),
len,
);
}