~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to kernel/compat.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
293
293
        return compat_jiffies_to_clock_t(jiffies);
294
294
}
295
295
 
 
296
#ifdef __ARCH_WANT_SYS_SIGPENDING
 
297
 
296
298
/*
297
299
 * Assumption: old_sigset_t and compat_old_sigset_t are both
298
300
 * types that can be passed to put_user()/get_user().
312
314
        return ret;
313
315
}
314
316
 
 
317
#endif
 
318
 
 
319
#ifdef __ARCH_WANT_SYS_SIGPROCMASK
 
320
 
315
321
asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
316
322
                compat_old_sigset_t __user *oset)
317
323
{
333
339
        return ret;
334
340
}
335
341
 
 
342
#endif
 
343
 
336
344
asmlinkage long compat_sys_setrlimit(unsigned int resource,
337
345
                struct compat_rlimit __user *rlim)
338
346
{
890
898
{
891
899
        compat_sigset_t s32;
892
900
        sigset_t s;
893
 
        int sig;
894
901
        struct timespec t;
895
902
        siginfo_t info;
896
 
        long ret, timeout = 0;
 
903
        long ret;
897
904
 
898
905
        if (sigsetsize != sizeof(sigset_t))
899
906
                return -EINVAL;
901
908
        if (copy_from_user(&s32, uthese, sizeof(compat_sigset_t)))
902
909
                return -EFAULT;
903
910
        sigset_from_compat(&s, &s32);
904
 
        sigdelsetmask(&s,sigmask(SIGKILL)|sigmask(SIGSTOP));
905
 
        signotset(&s);
906
911
 
907
912
        if (uts) {
908
 
                if (get_compat_timespec (&t, uts))
 
913
                if (get_compat_timespec(&t, uts))
909
914
                        return -EFAULT;
910
 
                if (t.tv_nsec >= 1000000000L || t.tv_nsec < 0
911
 
                                || t.tv_sec < 0)
912
 
                        return -EINVAL;
913
 
        }
914
 
 
915
 
        spin_lock_irq(&current->sighand->siglock);
916
 
        sig = dequeue_signal(current, &s, &info);
917
 
        if (!sig) {
918
 
                timeout = MAX_SCHEDULE_TIMEOUT;
919
 
                if (uts)
920
 
                        timeout = timespec_to_jiffies(&t)
921
 
                                +(t.tv_sec || t.tv_nsec);
922
 
                if (timeout) {
923
 
                        current->real_blocked = current->blocked;
924
 
                        sigandsets(&current->blocked, &current->blocked, &s);
925
 
 
926
 
                        recalc_sigpending();
927
 
                        spin_unlock_irq(&current->sighand->siglock);
928
 
 
929
 
                        timeout = schedule_timeout_interruptible(timeout);
930
 
 
931
 
                        spin_lock_irq(&current->sighand->siglock);
932
 
                        sig = dequeue_signal(current, &s, &info);
933
 
                        current->blocked = current->real_blocked;
934
 
                        siginitset(&current->real_blocked, 0);
935
 
                        recalc_sigpending();
936
 
                }
937
 
        }
938
 
        spin_unlock_irq(&current->sighand->siglock);
939
 
 
940
 
        if (sig) {
941
 
                ret = sig;
942
 
                if (uinfo) {
943
 
                        if (copy_siginfo_to_user32(uinfo, &info))
944
 
                                ret = -EFAULT;
945
 
                }
946
 
        }else {
947
 
                ret = timeout?-EINTR:-EAGAIN;
948
 
        }
 
915
        }
 
916
 
 
917
        ret = do_sigtimedwait(&s, &info, uts ? &t : NULL);
 
918
 
 
919
        if (ret > 0 && uinfo) {
 
920
                if (copy_siginfo_to_user32(uinfo, &info))
 
921
                        ret = -EFAULT;
 
922
        }
 
923
 
949
924
        return ret;
950
925
 
951
926
}