/* Note that we don't need to acquire the kernel lock for SMP operation, as all of this is local to this thread.  */
SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, struct pt_regs *, regs)
/* Note that we don't need to acquire the kernel lock for SMP operation, as all of this is local to this thread.  */
SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask, struct pt_regs *, regs)
{
	unsigned long oldmask = -EINVAL;
	if ((unsigned long)how-1 <= 2) {
		long sign = how-2;
		unsigned long block, unblock;
		newmask &= _BLOCKABLE;
		spin_lock_irq(&current->sighand->siglock);
		oldmask = current->blocked.sig[0];
		unblock = oldmask & ~newmask;
		block = oldmask | newmask;
		if (!sign)
			block = unblock;
		if (sign <= 0)
			newmask = block;
		if (_NSIG_WORDS > 1 && sign > 0)
			sigemptyset(&current->blocked);
		current->blocked.sig[0] = newmask;
		recalc_sigpending();
		spin_unlock_irq(&current->sighand->siglock);
		regs->r0 = 0;
	}
	return oldmask;
}