kernel/proc/signal.c
/*
 * SigSuspend();
 *
 * Waits for a user-signal to occur,  mask_in controls which signals are to be
 * accepted (0) or ignored (1).  The previous state of the signal mask is stored
 * in signal.sigsuspend_oldmask and a flag, use_sigsuspend_mask is set to indicate
 * that we are returning from USigSuspend().
 *
 * A call to DeliverUserSignals() occurs before all system calls complete.  This
 * checks the use_sigsuspend_mask find out if we are returning from a USigSuspend()
 * system call.  If we are returning from USigSuspend() it restores the the sig_mask
 * to sigsuspend_oldmask _after_ choosing what signal to deliver based on the current
 * mask that was set in USigSuspend().
 */
SigSuspend();
Waits for a user-signal to occur,  mask_in controls which signals are to be
accepted (0) or ignored (1).  The previous state of the signal mask is stored
in signal.sigsuspend_oldmask and a flag, use_sigsuspend_mask is set to indicate
that we are returning from USigSuspend().

A call to DeliverUserSignals() occurs before all system calls complete.  This
checks the use_sigsuspend_mask find out if we are returning from a USigSuspend()
system call.  If we are returning from USigSuspend() it restores the the sig_mask
to sigsuspend_oldmask _after_ choosing what signal to deliver based on the current
mask that was set in USigSuspend().
SigSuspend () ; Waits for a user - signal to occur mask_in controls which signals are to be accepted ( 0 ) or ignored ( 1 ) . The previous state of the signal mask is stored in signal . sigsuspend_oldmask and a flag use_sigsuspend_mask is set to indicate that we are returning from USigSuspend () . A call to DeliverUserSignals () occurs before all system calls complete . This checks the use_sigsuspend_mask find out if we are returning from a USigSuspend () system call . If we are returning from USigSuspend () it restores the the sig_mask to sigsuspend_oldmask _after_ choosing what signal to deliver based on the current mask that was set in USigSuspend () .
int SigSuspend (const sigset_t *mask_in)
{
	sigset_t mask;
	uint32_t intstate;
	struct Process *current;
	current = GetCurrentProcess();
	if (CopyIn (&mask, mask_in, sizeof (sigset_t)) != 0) {
	  return -EFAULT;
	}
	DisableInterrupts();
	current->signal.sigsuspend_oldmask = current->signal.sig_mask;
	current->signal.use_sigsuspend_mask = true;
	current->signal.sig_mask = mask;
	if ((current->signal.sig_pending & ~current->signal.sig_mask) == 0)
	{
	}
	EnableInterrupts();	
	return -1;
}
int SigSuspend ( const sigset_t * mask_in ) { sigset_t mask ; uint32_t intstate ; struct Process * current ; current = GetCurrentProcess ( ) ; if ( CopyIn ( & mask , mask_in , sizeof ( sigset_t ) ) != 0 ) { return - EFAULT ; } DisableInterrupts ( ) ; current -> signal . sigsuspend_oldmask = current -> signal . sig_mask ; current -> signal . use_sigsuspend_mask = true ; current -> signal . sig_mask = mask ; if ( ( current -> signal . sig_pending & ~ current -> signal . sig_mask ) == 0 ) { } EnableInterrupts ( ) ; return -1 ; }
SigSuspend();
 Waits for a user-signal to occur,  mask_in controls which signals are to be
 accepted (0) or ignored (1).
SigSuspend () ; Waits for a user - signal to occur mask_in controls which signals are to be accepted ( 0 ) or ignored ( 1 ) .
//		KWait (SIGF_USER);