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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 2 Apr 2009, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
>
> glibc entriely and use a syscall prototype which works without
> arch-specific wrappers inside the kernel: The offset argument is
> explicitly split into two 32bit values.

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?

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

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux