for (s = 1; s <= NSIG; s++) {
for (s = 1; s < NSIG; s++) {
int sigwait(const sigset_t * set, int * sig){  volatile pthread_descr self = thread_self();  sigset_t mask;  int s;  sigjmp_buf jmpbuf;  struct sigaction sa;  /* Get ready to block all signals except those in set     and the cancellation signal.     Also check that handlers are installed on all signals in set,     and if not, install our dummy handler.  This is conformant to     POSIX: "The effect of sigwait() on the signal actions for the     signals in set is unspecified." */  sigfillset(&mask);  sigdelset(&mask, __pthread_sig_cancel);  for (s = 1; s <= NSIG; s++) {    if (sigismember(set, s) &&        s != __pthread_sig_restart &&        s != __pthread_sig_cancel &&        s != __pthread_sig_debug) {      sigdelset(&mask, s);      if (sighandler[s].old == NULL ||          sighandler[s].old == (arch_sighandler_t) SIG_DFL ||          sighandler[s].old == (arch_sighandler_t) SIG_IGN) {        sa.sa_handler = pthread_null_sighandler;        sigemptyset(&sa.sa_mask);        sa.sa_flags = 0;        sigaction(s, &sa, NULL);      }    }  }  /* Test for cancellation */  if (sigsetjmp(jmpbuf, 1) == 0) {    THREAD_SETMEM(self, p_cancel_jmp, &jmpbuf);    if (! (THREAD_GETMEM(self, p_canceled)	   && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE)) {      /* Reset the signal count */      THREAD_SETMEM(self, p_signal, 0);      /* Say we're in sigwait */      THREAD_SETMEM(self, p_sigwaiting, 1);      /* Unblock the signals and wait for them */      sigsuspend(&mask);    }  }  THREAD_SETMEM(self, p_cancel_jmp, NULL);  /* The signals are now reblocked.  Check for cancellation */  pthread_testcancel();  /* We should have self->p_signal != 0 and equal to the signal received */  *sig = THREAD_GETMEM(self, p_signal);  return 0;}