commit 23c4f55a612842d8544a9dfe604a9caf1ca39697 (tree)
parent 9ef615104acb0f7cfed8f871404679a7df5571fe
Author: David CARLIER <devnexen@gmail.com>
Date: Sat, 22 Apr 2023 09:06:06 +0100
std: adding sigevent to supported platforms.
Diffstat:
5 files changed, 99 insertions(+), 0 deletions(-)
diff --git a/lib/std/c/dragonfly.zig b/lib/std/c/dragonfly.zig
@@ -1143,3 +1143,20 @@ pub const POLL = struct {
pub const HUP = 0x0010;
pub const NVAL = 0x0020;
};
+
+pub const SIGEV = struct {
+ pub const NONE = 0;
+ pub const SIGNAL = 1;
+ pub const THREAD = 2;
+};
+
+pub const sigevent = extern struct {
+ sigev_notify: c_int,
+ __sigev_u: extern union {
+ __sigev_signo: c_int,
+ __sigev_notify_kqueue: c_int,
+ __sigev_notify_attributes: ?*pthread_attr_t,
+ },
+ sigev_value: sigval,
+ sigev_notify_function: ?*const fn (sigval) callconv(.C) void,
+};
diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig
@@ -2248,3 +2248,28 @@ pub const shm_largeconf = extern struct {
pub extern "c" fn shm_create_largepage(path: [*:0]const u8, flags: c_int, psind: c_int, alloc_policy: c_int, mode: mode_t) c_int;
pub extern "c" fn elf_aux_info(aux: c_int, buf: ?*anyopaque, buflen: c_int) c_int;
+
+pub const lwpid = i32;
+
+pub const SIGEV = struct {
+ pub const NONE = 0;
+ pub const SIGNAL = 1;
+ pub const THREAD = 2;
+ pub const KEVENT = 3;
+ pub const THREAD_ID = 4;
+};
+
+pub const sigevent = extern struct {
+ sigev_notify: c_int,
+ sigev_signo: c_int,
+ sigev_value: sigval,
+ _sigev_un: extern union {
+ _threadid: lwpid,
+ _sigev_thread: extern struct {
+ _function: ?*const fn (sigval) callconv(.C) void,
+ _attribute: ?**pthread_attr_t,
+ },
+ _kevent_flags: c_ushort,
+ __spare__: [8]c_long,
+ },
+};
diff --git a/lib/std/c/haiku.zig b/lib/std/c/haiku.zig
@@ -1038,3 +1038,22 @@ pub const termios = extern struct {
};
pub const MSG_NOSIGNAL = 0x0800;
+
+pub const SIGEV = struct {
+ pub const NONE = 0;
+ pub const SIGNAL = 1;
+ pub const THREAD = 2;
+};
+
+pub const sigval = extern union {
+ int: c_int,
+ ptr: ?*anyopaque,
+};
+
+pub const sigevent = extern struct {
+ sigev_notify: c_int,
+ sigev_signo: c_int,
+ sigev_value: sigval,
+ sigev_notify_function: ?*const fn (sigval) callconv(.C) void,
+ sigev_notify_attributes: ?*pthread_attr_t,
+};
diff --git a/lib/std/c/netbsd.zig b/lib/std/c/netbsd.zig
@@ -1633,3 +1633,22 @@ pub const POLL = struct {
pub const HUP = 0x0010;
pub const NVAL = 0x0020;
};
+
+pub const SIGEV = struct {
+ pub const NONE = 0;
+ pub const SIGNAL = 1;
+ pub const THREAD = 2;
+};
+
+pub const sigval = extern union {
+ int: c_int,
+ ptr: ?*anyopaque,
+};
+
+pub const sigevent = extern struct {
+ sigev_notify: c_int,
+ sigev_signo: c_int,
+ sigev_value: sigval,
+ sigev_notify_function: ?*const fn (sigval) callconv(.C) void,
+ sigev_notify_attributes: ?*pthread_attr_t,
+};
diff --git a/lib/std/c/solaris.zig b/lib/std/c/solaris.zig
@@ -1927,3 +1927,22 @@ pub fn IOW(io_type: u8, nr: u8, comptime IOT: type) i32 {
pub fn IOWR(io_type: u8, nr: u8, comptime IOT: type) i32 {
return ioImpl(.read_write, io_type, nr, IOT);
}
+
+pub const SIGEV = struct {
+ pub const NONE = 0;
+ pub const SIGNAL = 1;
+ pub const THREAD = 2;
+};
+
+pub const sigval = extern union {
+ int: c_int,
+ ptr: ?*anyopaque,
+};
+
+pub const sigevent = extern struct {
+ sigev_notify: c_int,
+ sigev_signo: c_int,
+ sigev_value: sigval,
+ sigev_notify_function: ?*const fn (sigval) callconv(.C) void,
+ sigev_notify_attributes: ?*pthread_attr_t,
+};