-
-static bool
-is_member(int x, const int *array, size_t n)
-{
- size_t i;
-
- for (i = 0; i < n; i++) {
- if (array[i] == x) {
- return true;
- }
- }
- return false;
-}
-
-static bool
-sigchld_is_blocked(void)
-{
- sigset_t sigs;
-
- xpthread_sigmask(SIG_SETMASK, NULL, &sigs);
- return sigismember(&sigs, SIGCHLD);
-}
-
-static void
-block_sigchld(sigset_t *oldsigs)
-{
- sigset_t sigchld;
-
- sigemptyset(&sigchld);
- sigaddset(&sigchld, SIGCHLD);
- xpthread_sigmask(SIG_BLOCK, &sigchld, oldsigs);
-}
-
-static void
-unblock_sigchld(const sigset_t *oldsigs)
-{
- xpthread_sigmask(SIG_SETMASK, oldsigs, NULL);
-}