authorgravatar for 48339289+codic12@users.noreply.github.comcodic12 <48339289+codic12@users.noreply.github.com> 2021-06-11 06:28:20-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-06-11 16:28:20+03:00
log1b3cc663349b8088cd998b44cca4f78f37fed0f4
tree49e60944fa32332426ddf457a2e9bbd49590f41d
parent56c0a66ce30094d199420a3f2b2d2e759c1b0613
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

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.

1 files changed, 9 insertions(+), 0 deletions(-)

lib/std/c.zig+9
......@@ -208,6 +208,9 @@ pub usingnamespace switch (builtin.os.tag) {
208208 pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
209209 pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int;
210210 pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *libc_stat) c_int;
211 pub extern "c" fn sigfillset(set: ?*sigset_t) void;
212 pub extern "c" fn alarm(seconds: c_uint) c_uint;
213 pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int;
211214 },
212215 .windows => struct {
213216 // 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) {
222225 pub extern "c" fn sigaction(sig: c_int, noalias act: ?*const Sigaction, noalias oact: ?*Sigaction) c_int;
223226 pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
224227 pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *libc_stat) c_int;
228 pub extern "c" fn sigfillset(set: ?*sigset_t) void;
229 pub extern "c" fn alarm(seconds: c_uint) c_uint;
230 pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int;
225231 },
226232 else => struct {
227233 pub extern "c" fn clock_getres(clk_id: c_int, tp: *timespec) c_int;
......@@ -235,6 +241,9 @@ pub usingnamespace switch (builtin.os.tag) {
235241 pub extern "c" fn sigprocmask(how: c_int, noalias set: ?*const sigset_t, noalias oset: ?*sigset_t) c_int;
236242 pub extern "c" fn socket(domain: c_uint, sock_type: c_uint, protocol: c_uint) c_int;
237243 pub extern "c" fn stat(noalias path: [*:0]const u8, noalias buf: *libc_stat) c_int;
244 pub extern "c" fn sigfillset(set: ?*sigset_t) void;
245 pub extern "c" fn alarm(seconds: c_uint) c_uint;
246 pub extern "c" fn sigwait(set: ?*sigset_t, sig: ?*c_int) c_int;
238247 },
239248};
240249