Merge branch 'x86-acpi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / x86 / um / syscalls_32.c
1 /* 
2  * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com)
3  * Licensed under the GPL
4  */
5
6 #include <linux/syscalls.h>
7 #include <sysdep/syscalls.h>
8
9 long sys_sigaction(int sig, const struct old_sigaction __user *act,
10                          struct old_sigaction __user *oact)
11 {
12         struct k_sigaction new_ka, old_ka;
13         int ret;
14
15         if (act) {
16                 old_sigset_t mask;
17                 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
18                     __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
19                     __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
20                     __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
21                     __get_user(mask, &act->sa_mask))
22                         return -EFAULT;
23                 siginitset(&new_ka.sa.sa_mask, mask);
24         }
25
26         ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
27
28         if (!ret && oact) {
29                 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
30                     __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
31                     __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
32                     __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
33                     __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
34                         return -EFAULT;
35         }
36
37         return ret;
38 }