Re: [PATCH] Consolidate compat_sys_waitid

From: Matthew Wilcox
Date: Tue Feb 15 2005 - 13:49:59 EST


On Tue, Feb 15, 2005 at 02:01:49PM +1100, Stephen Rothwell wrote:
> Parisc seemed to assume th existance of compat_sys_waitid.

PA-RISC already has a compat_sys_waitid ;-P

The reason it isn't in Linus' tree yet is that it depends on the
is_compat_task() predicate which Andi vetoed out of Andrew's tree.
As a result, I haven't been able to merge any of the compat stuff
sitting in the PA tree. A few more voices in favour of reintroducing
is_compat_task() would help.

> @@ -413,6 +414,36 @@ compat_sys_wait4(compat_pid_t pid, compa
> }
> }
>
> +asmlinkage long compat_sys_waitid(u32 which, u32 pid,
> + struct compat_siginfo __user *uinfo, u32 options,
> + struct compat_rusage __user *uru)

Some subtle differences which I feel incompetent to diagnose ... ours
looks like:

asmlinkage int compat_sys_waitid(int which, pid_t pid,
compat_siginfo_t __user *infop, int options,
struct compat_rusage __user *ru)


> + BUG_ON(info.si_code & __SI_MASK);
> + info.si_code |= __SI_CHLD;
> + return copy_siginfo_to_user32(uinfo, &info);
> +}

Other than variable names, we're identical to this point:

/* Tell copy_siginfo_to_user that it was __SI_CHLD */
ksiginfo.si_code |= __SI_CHLD;

if (compat_copy_siginfo_to_user(infop, &ksiginfo) != 0)
return -EFAULT;

return 0;
}

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
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/