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

H.J. Lu hjl.tools at gmail.com
Mon Apr 16 14:28:21 UTC 2012


On Mon, Apr 16, 2012 at 3:22 AM, Denys Vlasenko <dvlasenk at redhat.com> wrote:
> 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.
>> This patch fixes it properly and prepares lseek for x32.
>
>
> Applied with some changes:
>
> - Define u_lrval only for arches which have it.
> - Same for RVAL_LUDECIMAL.
> - Comment out other RVAL_Lfoo consstants and code.
>

This patch is needed to support lseek for x32:

diff --git a/file.c b/file.c
index 58585f3..5f3b506 100644
--- a/file.c
+++ b/file.c
@@ -501,7 +501,7 @@ static const struct xlat whence[] = {
 	{ 0,		NULL		},
 };

-#if defined(LINUX_MIPSN32)
+#if defined(LINUX_MIPSN32) || defined(X32)
 int
 sys_lseek(struct tcb *tcp)
 {

Thanks.

-- 
H.J.




More information about the Strace-devel mailing list