2 * Unblock, reset, and raise a signal.
4 * Copyright (c) 2017-2018 Dmitry V. Levin <ldv@altlinux.org>
7 * SPDX-License-Identifier: GPL-2.0-or-later
16 main(int ac, char **av)
19 error_msg_and_fail("usage: unblock_raise signo");
23 const int signo = atoi(av[1]);
24 if (sigaddset(&mask, signo))
25 perror_msg_and_fail("sigaddset: %s", av[1]);
26 if (sigprocmask(SIG_UNBLOCK, &mask, NULL))
27 perror_msg_and_fail("sigprocmask");
28 if (signal(signo, SIG_DFL) == SIG_ERR)
29 perror_msg_and_fail("signal: %s", av[1]);
31 perror_msg_and_fail("raise: %s", av[1]);