diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-02-16 16:21:29 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:30:35 -0400 |
commit | 54f2da755b7f0bf022ea204240cba824af4d80ad (patch) | |
tree | 06c6a800c1023cab23566f33fccb05d9f1de9e73 /arch/mips/kernel/signal32.c | |
parent | a19050f301c55313826a649943d492c65f977479 (diff) |
Implement 32-bit compatibility for waitid(2).
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/signal32.c')
-rw-r--r-- | arch/mips/kernel/signal32.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 8ddfbd8d425a..d50daee51fba 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -902,3 +902,30 @@ asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t *uinfo) | |||
902 | set_fs (old_fs); | 902 | set_fs (old_fs); |
903 | return ret; | 903 | return ret; |
904 | } | 904 | } |
905 | |||
906 | asmlinkage long | ||
907 | sys32_waitid(int which, compat_pid_t pid, | ||
908 | compat_siginfo_t __user *uinfo, int options, | ||
909 | struct compat_rusage __user *uru) | ||
910 | { | ||
911 | siginfo_t info; | ||
912 | struct rusage ru; | ||
913 | long ret; | ||
914 | mm_segment_t old_fs = get_fs(); | ||
915 | |||
916 | info.si_signo = 0; | ||
917 | set_fs (KERNEL_DS); | ||
918 | ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options, | ||
919 | uru ? (struct rusage __user *) &ru : NULL); | ||
920 | set_fs (old_fs); | ||
921 | |||
922 | if (ret < 0 || info.si_signo == 0) | ||
923 | return ret; | ||
924 | |||
925 | if (uru && (ret = put_compat_rusage(&ru, uru))) | ||
926 | return ret; | ||
927 | |||
928 | BUG_ON(info.si_code & __SI_MASK); | ||
929 | info.si_code |= __SI_CHLD; | ||
930 | return copy_siginfo_to_user32(uinfo, &info); | ||
931 | } | ||