| author | |
| committer | |
| log | 217b95da31227fa346bb80568a9dc2971d1c7c1d |
| tree | eeb2b1e32b79be61a852b565940ae6c54d1bac12 |
| parent | 9babcac7a650373d9da7945c860fddcabe7050c8 |
| signature |
As `iovec_const` is to `iovec`, `msghdr_const` is to `msghdr`5 files changed, 61 insertions(+), 1 deletions(-)
std/c/freebsd.zig+17| ... | ... | @@ -58,6 +58,23 @@ pub const msghdr = extern struct { |
| 58 | 58 | msg_flags: i32, |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | pub const msghdr_const = extern struct { | |
| 62 | /// optional address | |
| 63 | msg_name: ?*const sockaddr, | |
| 64 | /// size of address | |
| 65 | msg_namelen: socklen_t, | |
| 66 | /// scatter/gather array | |
| 67 | msg_iov: [*]iovec_const, | |
| 68 | /// # elements in msg_iov | |
| 69 | msg_iovlen: i32, | |
| 70 | /// ancillary data | |
| 71 | msg_control: ?*c_void, | |
| 72 | /// ancillary data buffer len | |
| 73 | msg_controllen: socklen_t, | |
| 74 | /// flags on received message | |
| 75 | msg_flags: i32, | |
| 76 | }; | |
| 77 | ||
| 61 | 78 | pub const Stat = extern struct { |
| 62 | 79 | dev: u64, |
| 63 | 80 | ino: u64, |
std/c/netbsd.zig+17| ... | ... | @@ -58,6 +58,23 @@ pub const msghdr = extern struct { |
| 58 | 58 | msg_flags: i32, |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | pub const msghdr_const = extern struct { | |
| 62 | /// optional address | |
| 63 | msg_name: ?*const sockaddr, | |
| 64 | /// size of address | |
| 65 | msg_namelen: socklen_t, | |
| 66 | /// scatter/gather array | |
| 67 | msg_iov: [*]iovec_const, | |
| 68 | /// # elements in msg_iov | |
| 69 | msg_iovlen: i32, | |
| 70 | /// ancillary data | |
| 71 | msg_control: ?*c_void, | |
| 72 | /// ancillary data buffer len | |
| 73 | msg_controllen: socklen_t, | |
| 74 | /// flags on received message | |
| 75 | msg_flags: i32, | |
| 76 | }; | |
| 77 | ||
| 61 | 78 | pub const Stat = extern struct { |
| 62 | 79 | dev: u64, |
| 63 | 80 | mode: u32, |
std/os/linux.zig+1-1| ... | ... | @@ -1213,7 +1213,7 @@ pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noal |
| 1213 | 1213 | return syscall5(SYS_getsockopt, @bitCast(usize, isize(fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen)); |
| 1214 | 1214 | } |
| 1215 | 1215 | |
| 1216 | pub fn sendmsg(fd: i32, msg: *const msghdr, flags: u32) usize { | |
| 1216 | pub fn sendmsg(fd: i32, msg: *msghdr_const, flags: u32) usize { | |
| 1217 | 1217 | return syscall3(SYS_sendmsg, @bitCast(usize, isize(fd)), @ptrToInt(msg), flags); |
| 1218 | 1218 | } |
| 1219 | 1219 |
std/os/linux/arm64.zig+13| ... | ... | @@ -2,6 +2,7 @@ const std = @import("../../std.zig"); |
| 2 | 2 | const linux = std.os.linux; |
| 3 | 3 | const socklen_t = linux.socklen_t; |
| 4 | 4 | const iovec = linux.iovec; |
| 5 | const iovec_const = linux.iovec_const; | |
| 5 | 6 | |
| 6 | 7 | pub const SYS_io_setup = 0; |
| 7 | 8 | pub const SYS_io_destroy = 1; |
| ... | ... | @@ -426,6 +427,18 @@ pub const msghdr = extern struct { |
| 426 | 427 | msg_flags: i32, |
| 427 | 428 | }; |
| 428 | 429 | |
| 430 | pub const msghdr_const = extern struct { | |
| 431 | msg_name: ?*const sockaddr, | |
| 432 | msg_namelen: socklen_t, | |
| 433 | msg_iov: [*]iovec_const, | |
| 434 | msg_iovlen: i32, | |
| 435 | __pad1: i32, | |
| 436 | msg_control: ?*c_void, | |
| 437 | msg_controllen: socklen_t, | |
| 438 | __pad2: socklen_t, | |
| 439 | msg_flags: i32, | |
| 440 | }; | |
| 441 | ||
| 429 | 442 | /// Renamed to Stat to not conflict with the stat function. |
| 430 | 443 | pub const Stat = extern struct { |
| 431 | 444 | dev: u64, |
std/os/linux/x86_64.zig+13| ... | ... | @@ -3,6 +3,7 @@ const linux = std.os.linux; |
| 3 | 3 | const sockaddr = linux.sockaddr; |
| 4 | 4 | const socklen_t = linux.socklen_t; |
| 5 | 5 | const iovec = linux.iovec; |
| 6 | const iovec_const = linux.iovec_const; | |
| 6 | 7 | |
| 7 | 8 | pub const SYS_read = 0; |
| 8 | 9 | pub const SYS_write = 1; |
| ... | ... | @@ -495,6 +496,18 @@ pub const msghdr = extern struct { |
| 495 | 496 | msg_flags: i32, |
| 496 | 497 | }; |
| 497 | 498 | |
| 499 | pub const msghdr_const = extern struct { | |
| 500 | msg_name: ?*const sockaddr, | |
| 501 | msg_namelen: socklen_t, | |
| 502 | msg_iov: [*]iovec_const, | |
| 503 | msg_iovlen: i32, | |
| 504 | __pad1: i32, | |
| 505 | msg_control: ?*c_void, | |
| 506 | msg_controllen: socklen_t, | |
| 507 | __pad2: socklen_t, | |
| 508 | msg_flags: i32, | |
| 509 | }; | |
| 510 | ||
| 498 | 511 | /// Renamed to Stat to not conflict with the stat function. |
| 499 | 512 | pub const Stat = extern struct { |
| 500 | 513 | dev: u64, |