aboutsummaryrefslogtreecommitdiff
path: root/std/c
diff options
context:
space:
mode:
authorhryx <codroid@gmail.com>2019-05-12 02:00:49 -0700
committerhryx <codroid@gmail.com>2019-05-12 02:00:49 -0700
commit3787f3428625e830fd852a8f5a40c7d8a2d429f6 (patch)
tree23fb493b9d2f07c7abe57955874682959936319a /std/c
parent16aee1f58a80295f7599a8290d764a5c7040c373 (diff)
parentedcc7c72d1a684a8a16ca23ad26689f2cce4e803 (diff)
downloadzig-3787f3428625e830fd852a8f5a40c7d8a2d429f6.tar.gz
zig-3787f3428625e830fd852a8f5a40c7d8a2d429f6.zip
Merge branch 'master' into rebased
Diffstat (limited to 'std/c')
-rw-r--r--std/c/freebsd.zig32
-rw-r--r--std/c/linux.zig4
-rw-r--r--std/c/netbsd.zig32
3 files changed, 58 insertions, 10 deletions
diff --git a/std/c/freebsd.zig b/std/c/freebsd.zig
index 2f2f4c0a1b..b6cf15bf31 100644
--- a/std/c/freebsd.zig
+++ b/std/c/freebsd.zig
@@ -42,14 +42,36 @@ pub const pthread_attr_t = extern struct {
};
pub const msghdr = extern struct {
- msg_name: *u8,
+ /// optional address
+ msg_name: ?*sockaddr,
+ /// size of address
msg_namelen: socklen_t,
- msg_iov: *iovec,
+ /// scatter/gather array
+ msg_iov: [*]iovec,
+ /// # elements in msg_iov
msg_iovlen: i32,
- __pad1: i32,
- msg_control: *u8,
+ /// ancillary data
+ msg_control: ?*c_void,
+ /// ancillary data buffer len
msg_controllen: socklen_t,
- __pad2: socklen_t,
+ /// flags on received message
+ msg_flags: i32,
+};
+
+pub const msghdr_const = extern struct {
+ /// optional address
+ msg_name: ?*const sockaddr,
+ /// size of address
+ msg_namelen: socklen_t,
+ /// scatter/gather array
+ msg_iov: [*]iovec_const,
+ /// # elements in msg_iov
+ msg_iovlen: i32,
+ /// ancillary data
+ msg_control: ?*c_void,
+ /// ancillary data buffer len
+ msg_controllen: socklen_t,
+ /// flags on received message
msg_flags: i32,
};
diff --git a/std/c/linux.zig b/std/c/linux.zig
index b0dadf071d..48e359f361 100644
--- a/std/c/linux.zig
+++ b/std/c/linux.zig
@@ -1,3 +1,4 @@
+const linux = @import("../os/linux.zig");
pub use @import("../os/linux/errno.zig");
pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) c_int;
@@ -11,3 +12,6 @@ pub const pthread_attr_t = extern struct {
/// See std.elf for constants for this
pub extern fn getauxval(__type: c_ulong) c_ulong;
+
+pub const dl_iterate_phdr_callback = extern fn (info: *linux.dl_phdr_info, size: usize, data: ?*c_void) c_int;
+pub extern fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;
diff --git a/std/c/netbsd.zig b/std/c/netbsd.zig
index 796d45dafc..2c07ee296b 100644
--- a/std/c/netbsd.zig
+++ b/std/c/netbsd.zig
@@ -42,14 +42,36 @@ pub const pthread_attr_t = extern struct {
};
pub const msghdr = extern struct {
- msg_name: *u8,
+ /// optional address
+ msg_name: ?*sockaddr,
+ /// size of address
msg_namelen: socklen_t,
- msg_iov: *iovec,
+ /// scatter/gather array
+ msg_iov: [*]iovec,
+ /// # elements in msg_iov
msg_iovlen: i32,
- __pad1: i32,
- msg_control: *u8,
+ /// ancillary data
+ msg_control: ?*c_void,
+ /// ancillary data buffer len
msg_controllen: socklen_t,
- __pad2: socklen_t,
+ /// flags on received message
+ msg_flags: i32,
+};
+
+pub const msghdr_const = extern struct {
+ /// optional address
+ msg_name: ?*const sockaddr,
+ /// size of address
+ msg_namelen: socklen_t,
+ /// scatter/gather array
+ msg_iov: [*]iovec_const,
+ /// # elements in msg_iov
+ msg_iovlen: i32,
+ /// ancillary data
+ msg_control: ?*c_void,
+ /// ancillary data buffer len
+ msg_controllen: socklen_t,
+ /// flags on received message
msg_flags: i32,
};