mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
make msghdr.iovlen unsigned
I don't care what C headers say. This value is never supposed to be negative.
This commit is contained in:
parent
9a1f4cb011
commit
890f1fa848
2 changed files with 3 additions and 3 deletions
|
|
@ -4110,7 +4110,7 @@ pub const msghdr_const = switch (native_os) {
|
|||
/// scatter/gather array
|
||||
iov: [*]const iovec_const,
|
||||
/// # elements in iov
|
||||
iovlen: i32,
|
||||
iovlen: u32,
|
||||
/// ancillary data
|
||||
control: ?*const anyopaque,
|
||||
/// ancillary data buffer len
|
||||
|
|
@ -4122,7 +4122,7 @@ pub const msghdr_const = switch (native_os) {
|
|||
name: ?*const anyopaque,
|
||||
namelen: socklen_t,
|
||||
iov: [*]const iovec,
|
||||
iovlen: c_int,
|
||||
iovlen: c_uint,
|
||||
control: ?*const anyopaque,
|
||||
controllen: socklen_t,
|
||||
flags: c_int,
|
||||
|
|
|
|||
|
|
@ -2125,7 +2125,7 @@ pub const Stream = struct {
|
|||
return .{ .handle = w.file_writer.file.handle };
|
||||
}
|
||||
|
||||
fn addBuf(v: []posix.iovec_const, i: *usize, bytes: []const u8) void {
|
||||
fn addBuf(v: []posix.iovec_const, i: *@FieldType(posix.msghdr_const, "iovlen"), bytes: []const u8) void {
|
||||
// OS checks ptr addr before length so zero length vectors must be omitted.
|
||||
if (bytes.len == 0) return;
|
||||
if (v.len - i.* == 0) return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue