On Tuesday 16 December 2008, Kyle McMartin wrote:
quoted
I'd prefer to have the ordering coded explicitly instead, like this:
asmlinkage int compat_sys_pwritev(unsigned long fd,
const struct compat_iovec __user *vec, unsigned long vlen,
unsigned pos_low, unsigned pos_high)
{
loff_t pos = pos_low | (loff_t)pos_high << 32;
[ ... ]
Sadly this isn't possible without a wrapper unless you can guarantee
it was passed low high instead of high low. Unless you munge it in
userspace, you can't.
Exactly, we have to munge it in userspace anyway because of the
argument ordering requirement we get if we pass it as a single u64.
I vote for the explicit split as well, this will give us a straightforward
wrapper in user space, unlike the swapped arguments that are just asking
for trouble, and will make it easy to have a common compat_sys_pwritev
function.
Arnd <><