Re: [PATCH] unify sys_pipe implementation

From: Linus Torvalds
Date: Sat May 03 2008 - 13:15:29 EST




On Sat, 3 May 2008, Ulrich Drepper wrote:
>
> +#ifdef __ARCH_WANT_SYS_PIPE
> +/*
> + * sys_pipe() is the normal C calling standard for creating
> + * a pipe. It's not the way Unix traditionally does this, though.
> + */
> +asmlinkage long sys_pipe(unsigned long __user *fildes)

Gaah. If you do this, at least clean it up and use "int *fildes", rather
than copying the uglier old "unsigned long" ones that only exist because
originally we had lots of odd int/long things that didn't matter on x86.

Yeah, yeah, the thing that matters is actually

> + int fd[2];
> ...
> + if (copy_to_user(fildes, fd, sizeof(fd)))

so it happens to work on all architectures anyway, but..

Also, we shouldn't need __ARCH_WANT_SYS_PIPE for this. Just make it
unconditional, and then any architecture that wants somethign else can do
their own "myarch_sys_pipe()" or whatever.

Linus
--
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/