blob: 3acba2638ca04420ded9d1366322261b3d55007c [file] [log] [blame]
William A. Kennington III9c97d2c2018-11-02 17:25:36 -07001#include <signal.h>
Patrick Williamsd1984dd2023-05-10 16:12:44 -05002
William A. Kennington III9c97d2c2018-11-02 17:25:36 -07003#include <stdplus/signal.hpp>
William A. Kennington III64725032019-07-01 17:53:13 -07004#include <stdplus/util/cexec.hpp>
Patrick Williamsd1984dd2023-05-10 16:12:44 -05005
William A. Kennington III9c97d2c2018-11-02 17:25:36 -07006#include <system_error>
7
8namespace stdplus
9{
10namespace signal
11{
12
13void block(int signum)
14{
15 sigset_t set;
William A. Kennington III80c988f2020-08-02 02:54:22 -070016 CHECK_ERRNO(sigprocmask(SIG_BLOCK, nullptr, &set), "sigprocmask get");
17 CHECK_ERRNO(sigaddset(&set, signum), "sigaddset");
18 CHECK_ERRNO(sigprocmask(SIG_BLOCK, &set, nullptr), "sigprocmask set");
William A. Kennington III9c97d2c2018-11-02 17:25:36 -070019}
20
21} // namespace signal
22} // namespace stdplus