Re: [PATCH] waitid system call

From: Andi Kleen
Date: Sun Aug 15 2004 - 19:06:07 EST


Roland McGrath <roland@xxxxxxxxxx> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/