| author | |
| committer | |
| log | 9636d76b6d26d142f7d23e6d25eec1c28cf571b4 |
| tree | 8b9fd1906c87592d136075d390a37f9228043e33 |
| parent | 21914c7c01d8d1071034153451414719906167b8 |
https://github.com/torvalds/linux/blob/e774d5f1bc27a85f858bce7688509e866f8e8a4e/include/linux/syscalls.h#L1100-L1102
https://github.com/torvalds/linux/blob/e774d5f1bc27a85f858bce7688509e866f8e8a4e/include/linux/syscalls.h#L477-L479
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31825
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: Meghan Denny <hello@nektro.net>
Co-committed-by: Meghan Denny <hello@nektro.net>3 files changed, 6 insertions(+), 6 deletions(-)
lib/std/Io/Threaded.zig+1-1| ... | ... | @@ -5484,7 +5484,7 @@ fn dirReadLinux(userdata: ?*anyopaque, dr: *Dir.Reader, buffer: []Dir.Entry) Dir |
| 5484 | 5484 | } |
| 5485 | 5485 | const syscall: Syscall = try .start(); |
| 5486 | 5486 | const n = while (true) { |
| 5487 | const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, dr.buffer.len); | |
| 5487 | const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, @min(dr.buffer.len, std.math.maxInt(c_uint))); | |
| 5488 | 5488 | switch (linux.errno(rc)) { |
| 5489 | 5489 | .SUCCESS => { |
| 5490 | 5490 | syscall.finish(); |
lib/std/Io/Uring.zig+1-1| ... | ... | @@ -3070,7 +3070,7 @@ fn dirRead(userdata: ?*anyopaque, dr: *Dir.Reader, buffer: []Dir.Entry) Dir.Read |
| 3070 | 3070 | } |
| 3071 | 3071 | const n = while (true) { |
| 3072 | 3072 | try sync.cancel_region.await(.nothing); |
| 3073 | const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, dr.buffer.len); | |
| 3073 | const rc = linux.getdents64(dr.dir.handle, dr.buffer.ptr, @min(dr.buffer.len, std.math.maxInt(c_uint))); | |
| 3074 | 3074 | switch (linux.errno(rc)) { |
| 3075 | 3075 | .SUCCESS => break rc, |
| 3076 | 3076 | .INTR => {}, |
lib/std/os/linux.zig+4-4| ... | ... | @@ -887,21 +887,21 @@ pub fn getcwd(buf: [*]u8, size: usize) usize { |
| 887 | 887 | return syscall2(.getcwd, @intFromPtr(buf), size); |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | pub fn getdents(fd: fd_t, dirp: [*]u8, len: usize) usize { | |
| 890 | pub fn getdents(fd: fd_t, dirp: [*]u8, len: c_uint) usize { | |
| 891 | 891 | return syscall3( |
| 892 | 892 | .getdents, |
| 893 | 893 | @as(u32, @bitCast(fd)), |
| 894 | 894 | @intFromPtr(dirp), |
| 895 | @min(len, maxInt(c_int)), | |
| 895 | len, | |
| 896 | 896 | ); |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | pub fn getdents64(fd: fd_t, dirp: [*]u8, len: usize) usize { | |
| 899 | pub fn getdents64(fd: fd_t, dirp: [*]u8, len: c_uint) usize { | |
| 900 | 900 | return syscall3( |
| 901 | 901 | .getdents64, |
| 902 | 902 | @as(u32, @bitCast(fd)), |
| 903 | 903 | @intFromPtr(dirp), |
| 904 | @min(len, maxInt(c_int)), | |
| 904 | len, | |
| 905 | 905 | ); |
| 906 | 906 | } |
| 907 | 907 |