Re: [patch 143/166] preadv/pwritev: Add preadv and pwritev system calls.

H. Peter Anvin
2009-04-03T16:57:49Z

Linus Torvalds wrote:
>
> Grr. That may make sense on 32-bit architectures, but makes no sense
> what-so-ever on 64-bit ones.
>
> Why not just say that it's two "unsigned long" arguments, and split it by
> "sizeof unsigned long". And then, on 64-bit architectures, the high bits
> can be ignored. You can even get gcc to optimize it all away by doing
> something like
>
> #define HALF_LONG (BITS_IN_LONG / 2)
>
> offset = (((loff_t)high << HALF_LONG) << HALF_LONG) | low;
>
> and then gcc should automaticaly notice that shifting up that way is just
> a fancy way of saying "0", and ignore the high bits.
>
> How married are people to this crazy 2x "32 bits" model?
>

I certainly am *not* happy with it, and said so when it was first
posted. My main complaint with it is that it introduces yet another
special case in the kernel<->userspace ABI, because although we've had
this problem before, it has been hacked around a different way every time.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html