return ret;
}
-extern int
-copy_siginfo_to_user32(siginfo_t32 *to, siginfo_t *from);
-
-asmlinkage long
-sys32_rt_sigtimedwait(compat_sigset_t *uthese, siginfo_t32 *uinfo,
- struct compat_timespec *uts, size_t sigsetsize)
-{
- int ret, sig;
- sigset_t these;
- compat_sigset_t these32;
- struct timespec ts;
- siginfo_t info;
- long timeout = 0;
-
- /* XXX: Don't preclude handling different sized sigset_t's. */
- if (sigsetsize != sizeof(sigset_t))
- return -EINVAL;
-
- if (copy_from_user (&these32, uthese, sizeof(compat_sigset_t)))
- return -EFAULT;
-
- switch (_NSIG_WORDS) {
- case 4: these.sig[3] = these32.sig[6] | (((long)these32.sig[7]) << 32);
- case 3: these.sig[2] = these32.sig[4] | (((long)these32.sig[5]) << 32);
- case 2: these.sig[1] = these32.sig[2] | (((long)these32.sig[3]) << 32);
- case 1: these.sig[0] = these32.sig[0] | (((long)these32.sig[1]) << 32);
- }
-
- /*
- * Invert the set of allowed signals to get those we
- * want to block.
- */
- sigdelsetmask(&these, sigmask(SIGKILL)|sigmask(SIGSTOP));
- signotset(&these);
-
- if (uts) {
- if (get_compat_timespec(&ts, uts))
- return -EINVAL;
- if (ts.tv_nsec >= 1000000000L || ts.tv_nsec < 0
- || ts.tv_sec < 0)
- return -EINVAL;
- }
-
- spin_lock_irq(¤t->sighand->siglock);
- sig = dequeue_signal(current, &these, &info);
- if (!sig) {
- /* None ready -- temporarily unblock those we're interested
- in so that we'll be awakened when they arrive. */
- current->real_blocked = current->blocked;
- sigandsets(¤t->blocked, ¤t->blocked, &these);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
-
- timeout = MAX_SCHEDULE_TIMEOUT;
- if (uts)
- timeout = (timespec_to_jiffies(&ts)
- + (ts.tv_sec || ts.tv_nsec));
-
- current->state = TASK_INTERRUPTIBLE;
- timeout = schedule_timeout(timeout);
-
- spin_lock_irq(¤t->sighand->siglock);
- sig = dequeue_signal(current, &these, &info);
- current->blocked = current->real_blocked;
- siginitset(¤t->real_blocked, 0);
- recalc_sigpending();
- }
- spin_unlock_irq(¤t->sighand->siglock);
-
- if (sig) {
- ret = sig;
- if (uinfo) {
- if (copy_siginfo_to_user32(uinfo, &info))
- ret = -EFAULT;
- }
- } else {
- ret = -EAGAIN;
- if (timeout)
- ret = -EINTR;
- }
-
- return ret;
-}
-
asmlinkage long
-sys32_rt_sigqueueinfo(int pid, int sig, siginfo_t32 __user *uinfo)
+sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
{
siginfo_t info;
int ret;