[PATCH] 3/3 Generic sys_rt_sigsuspend

Mika Penttilä mika.penttila at kolumbus.fi
Tue Nov 29 16:18:03 EST 2005


David Woodhouse wrote:

>The TIF_RESTORE_SIGMASK flag allows us to have a generic implementation
>of sys_rt_sigsuspend() instead of duplicating it for each architecture.
>This provides such an implementation and makes arch/powerpc use it.
>
>It also tidies up the ppc32 sys_sigsuspend() to use TIF_RESTORE_SIGMASK.
>
>Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
>  
>
> 
>+#ifdef __ARCH_WANT_SYS_RT_SIGSUSPEND
>+long sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
>+{
>+	sigset_t saveset, newset;
>+
>+	/* XXX: Don't preclude handling different sized sigset_t's.  */
>+	if (sigsetsize != sizeof(sigset_t))
>+		return -EINVAL;
>+
>+	if (copy_from_user(&newset, unewset, sizeof(newset)))
>+		return -EFAULT;
>+	sigdelsetmask(&newset, sigmask(SIGKILL)|sigmask(SIGSTOP));
>+
>+	spin_lock_irq(&current->sighand->siglock);
>+	saveset = current->blocked;
>+	current->blocked = newset;
>+	recalc_sigpending();
>+	spin_unlock_irq(&current->sighand->siglock);
>+
>+	current->state = TASK_INTERRUPTIBLE;
>+	schedule();
>+	set_thread_flag(TIF_RESTORE_SIGMASK);
>+	return -ERESTARTNOHAND;
>+}
>+#endif /* __ARCH_WANT_SYS_RT_SIGSUSPEND */
>+
>  
>
You are not setting saved_sigmask here. And shouldn't it return -EINTR?

Thanks,
Mika




More information about the Linuxppc-dev mailing list