hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 903cdba271c4d60632b3858be8df3d006483ef22
parent 9b813f2dc2c3b39d870395661b9be633e5e3e15b
Author: Drew DeVault <sir@cmpwn.com>
Date:   Wed, 13 Mar 2024 10:46:59 +0100

unix::signal: add sigset_fill

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Munix/signal/+freebsd.ha | 5+++++
Munix/signal/+linux.ha | 5+++++
Munix/signal/+openbsd.ha | 5+++++
3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/unix/signal/+freebsd.ha b/unix/signal/+freebsd.ha @@ -176,6 +176,11 @@ export fn sigset_del(set: *sigset, items: sig...) void = { }; }; +// Adds all platform-defined signals to a [[sigset]]. +export fn sigset_fill(set: *sigset) void = { + rt::sigfillset(set: *rt::sigset)!; +}; + // Returns true if the given signal is a member of this [[sigset]]. export fn sigset_member(set: *sigset, item: sig) bool = { return rt::sigismember(set: *rt::sigset, item)!; diff --git a/unix/signal/+linux.ha b/unix/signal/+linux.ha @@ -178,6 +178,11 @@ export fn sigset_del(set: *sigset, items: sig...) void = { }; }; +// Adds all platform-defined signals to a [[sigset]]. +export fn sigset_fill(set: *sigset) void = { + rt::sigfillset(set: *rt::sigset); +}; + // Returns true if the given signal is a member of this [[sigset]]. export fn sigset_member(set: *sigset, item: sig) bool = { return rt::sigismember(set: *rt::sigset, item)!; diff --git a/unix/signal/+openbsd.ha b/unix/signal/+openbsd.ha @@ -175,6 +175,11 @@ export fn sigset_del(set: *sigset, items: sig...) void = { }; }; +// Adds all platform-defined signals to a [[sigset]]. +export fn sigset_fill(set: *sigset) void = { + rt::sigfillset(set: *rt::sigset)!; +}; + // Returns true if the given signal is a member of this [[sigset]]. export fn sigset_member(set: *sigset, item: sig) bool = { return rt::sigismember(set: *rt::sigset, item)!;