Re: [PATCH] waitid system call

Andi Kleen
2004-08-16T00:03:55Z

Roland McGrath <roland@redhat.com> writes:

Are you sure you converted the new _rusage member properly
in the 64->32bit siginfo converter? struct rusage uses long.

> +asmlinkage long sys32_waitid(int which, compat_pid_t pid,
> + siginfo_t32 __user *uinfo, int options)
> +{
> + siginfo_t info;
> + long ret;
> + mm_segment_t old_fs = get_fs();
> +
> + info.si_signo = 0;
> + set_fs (KERNEL_DS);
> + ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options);
> + set_fs (old_fs);

Better use compat_alloc_user_space() for this. Otherwise it won't
work for UML/x86-64. Also that will make it easier to port to other
architectures.

+ /* 1 if group stopped since last SIGCONT, -1 if SIGCONT since report */
+ int stop_state;

Can't this be merged into some other field? No need to waste memory
unnecessarily.

-Andi