- /* Handle any lingering signals with no-op */
- __libc_sigprocmask(SIG_UNBLOCK, &set, 0);
-
- /* Resume other threads' signal handlers and wait for them */
- rs.hold = 0;
- __wake(&rs.hold, -1, 0);
- while((i=rs.cnt)) __wait(&rs.cnt, 0, i, 1);
-
- if (rs.err) errno = rs.err, ret = -1;
- else ret = syscall6(nr, a, b, c, d, e, f);
-
- UNLOCK(&rs.lock);
- return ret;
-}
-
-static void init_threads()
-{
- struct sigaction sa = { .sa_flags = SA_SIGINFO | SA_RESTART };
- libc.lock = __lock;
- libc.cancelpt = cancelpt;
- libc.rsyscall = rsyscall;
- sa.sa_sigaction = cancel_handler;
- __libc_sigaction(SIGCANCEL, &sa, 0);
- sigaddset(&sa.sa_mask, SIGSYSCALL);
- sigaddset(&sa.sa_mask, SIGCANCEL);
- sa.sa_sigaction = rsyscall_handler;
- __libc_sigaction(SIGSYSCALL, &sa, 0);
- sigprocmask(SIG_UNBLOCK, &sa.sa_mask, 0);