linux-mips
[Top] [All Lists]

Re: N32 fallocate syscall

To: "Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: N32 fallocate syscall
From: Ralf Baechle <ralf@linux-mips.org>
Date: Thu, 18 Dec 2008 07:10:38 +0000
Cc: linux-mips@linux-mips.org
In-reply-to: <Pine.LNX.4.64.0812180009000.31179@digraph.polyomino.org.uk>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.64.0812180009000.31179@digraph.polyomino.org.uk>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, Dec 18, 2008 at 12:14:12AM +0000, Joseph S. Myers wrote:

> The N32 syscall table uses sys_fallocate instead of sys32_fallocate.  
> However, glibc expects to be using the syscall version with 32-bit 
> arguments on N32, which should work with sys32_fallocate but not 
> sys_fallocate.
> 
> What should the N32 interface for this syscall be?  My inclination is that 
> glibc is right not to do anything special and different from other 32-bit 
> ABIs here, and so sys32_fallocate should be used.
> 
> (glibc is also expecting the 32-bit version for N64, but that's a clear 
> bug in glibc that I'll be fixing.)

There are exceptions such as pipe(2) or clone(2) but the calling convention
of most syscalls in all ABIs is following the C calling conventions for the
respective ABI, so N32 fallocate(2) receives it's syscalls like a N32
function call would.

o32-style arguments would require splitting the two 64-bit loff_t arguments
to be split into 2 32-bit halfs each in userspace and those pairs then to
be re-assembled into 64-bit arguments in kernel.  Bit messy, no?

  Ralf

<Prev in Thread] Current Thread [Next in Thread>