commit 1b3cc663349b8088cd998b44cca4f78f37fed0f4 (tree)
parent 56c0a66ce30094d199420a3f2b2d2e759c1b0613
Author: codic12 <48339289+codic12@users.noreply.github.com>
Date: Fri, 11 Jun 2021 06:28:20 -0700
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.
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git 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;
},
};