From 1b3cc663349b8088cd998b44cca4f78f37fed0f4 Mon Sep 17 00:00:00 2001 From: codic12 <48339289+codic12@users.noreply.github.com> Date: Fri, 11 Jun 2021 06:28:20 -0700 Subject: [PATCH] c.zig: add sigfillset, alarm, sigwait I've added these three functions to all switches except NetBSD, because I don't know what the function is named there. I've even added it on the .windows switch since all the posix functions seem to be there anyways. --- lib/std/c.zig | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/std/c.zig b/lib/std/c.zig index a91fee7274dca60a653013c743543c9dddf3b5bb..183be6108f40276f6a53dad51e4f5d97fa92d394 100644 --- a/lib/std/c.zig +++ b/lib/std/c.zig @@ -208,6 +208,9 @@ pub usingnamespace switch (builtin.os.tag) { pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int; pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *libc_stat) c_int; + pub extern "c" fn sigfillset(set: ?*sigset_t) void; + pub extern "c" fn alarm(seconds: c_uint) c_uint; + pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int; }, .windows => struct { // TODO: copied the else case and removed the socket function (because its in ws2_32) @@ -222,6 +225,9 @@ pub usingnamespace switch (builtin.os.tag) { pub extern "c" fn sigaction(sig: c_int, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int; pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int; pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *libc_stat) c_int; + pub extern "c" fn sigfillset(set: ?*sigset_t) void; + pub extern "c" fn alarm(seconds: c_uint) c_uint; + pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int; }, else => struct { pub extern "c" fn clock_getres(clk_id: c_int, tp: *timespec) c_int; @@ -235,6 +241,9 @@ pub usingnamespace switch (builtin.os.tag) { pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int; pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int; pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *libc_stat) c_int; + pub extern "c" fn sigfillset(set: ?*sigset_t) void; + pub extern "c" fn alarm(seconds: c_uint) c_uint; + pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int; }, }; -- 2.54.0