int sigaction_set(int sig, const struct sigaction *act) FAST_FUNC;
/* SIG_BLOCK/SIG_UNBLOCK all signals: */
int sigprocmask_allsigs(int how) FAST_FUNC;
-/* SIG_SETMASK set, and return old set in the same set: */
-int sigprocmask_SIG_SETMASK(sigset_t *set) FAST_FUNC;
+/* Return old set in the same set: */
+int sigprocmask2(int how, sigset_t *set) FAST_FUNC;
/* Standard handler which just records signo */
extern smallint bb_got_signal;
void record_signo(int signo); /* not FAST_FUNC! */
return sigprocmask(how, &set, NULL);
}
-int FAST_FUNC sigprocmask_SIG_SETMASK(sigset_t *set)
+int FAST_FUNC sigprocmask2(int how, sigset_t *set)
{
// Grr... gcc 8.1.1:
// "passing argument 3 to restrict-qualified parameter aliases with argument 2"
// dance around that...
sigset_t *oset FIX_ALIASING;
oset = set;
- return sigprocmask(SIG_SETMASK, set, oset);
+ return sigprocmask(how, set, oset);
}
void FAST_FUNC bb_signals(int sigs, void (*f)(int))
sigaddset(m, SIGCHLD);
sigaddset(m, SIGHUP);
sigaddset(m, SIGALRM);
- sigprocmask(SIG_BLOCK, m, m); /* old sigmask is stored in m */
+ sigprocmask2(SIG_BLOCK, m); /* old sigmask is stored in m */
}
static void restore_sigmask(sigset_t *m)
/* Children exist, but none are ready. Sleep until interesting signal */
#if 1
sigfillset(&mask);
- sigprocmask_SIG_SETMASK(&mask); /* mask is updated */
+ sigprocmask2(SIG_SETMASK, &mask); /* mask is updated */
while (!got_sigchld && !pending_sig)
sigsuspend(&mask);
sigprocmask(SIG_SETMASK, &mask, NULL);
* and get stuck in sigsuspend...
*/
sigfillset(&oldset); /* block all signals, remember old set */
- sigprocmask_SIG_SETMASK(&oldset);
+ sigprocmask2(SIG_SETMASK, &oldset);
if (!sigisemptyset(&G.pending_set)) {
/* Crap! we raced with some signal! */