[PATCH 2/2] Properly support lseek for n32 and x32

Denys Vlasenko dvlasenk at redhat.com
Sun Apr 15 19:54:13 UTC 2012

On 04/15/2012 08:21 PM, H.J. Lu wrote:
> Hi,
> Linux kernel v3.4 adds x32 support.  Both x32 and n32 use 64bit offset
> for lseek parameter and return value.  We need u_lrval to handle it
> properly.  Also we shouldn't check HAVE_LONG_LONG_OFF_T for n32 lseek.

Please explain further. Not many people are familiar with MIPS...

Do syscalls on MIPS-n32 return 64-bit values even to 32-bit userspace?
How userspace is supposed to read that? Is 32-bit MIPS code
able to read 64-registers, or what?

> This patch fixes it properly and prepares lseek for x32.

Can you explain a bit further?
On x86, every syscall returns one long-sized (i.e., register-sized)
value in EAX/RAX. NO syscalls ever returned wider data.
If there was a need to do that, it was returned by reference.

Or it used to - did anything change? Or am I wrong?

How x32 lseek returns its value? In register pair?
Are there other such syscalls?


More information about the Strace-devel mailing list