sysdeps/unix/sysv/linux/lseek.c on ILP32 question

Steve Ellcey sellcey@caviumnetworks.com
Tue Feb 21 19:19:00 GMT 2017


On Tue, 2017-02-21 at 19:58 +0100, Andreas Schwab wrote:
> 
> > And I am not sure the conversion from offset to the two llseek
> > arguments is correct for both LP64 and ILP32 modes when offset is
> > negative.
> This isn't used for LP64, which won't have _llseek.
> 
> Andreas.

OK, that makes sense.  But there is still a problem with the test.c
example I attached to the email (attached here too).  I just tried this
on x86_64 and I get the same output difference that I see on aarch64.
Note that I am not even using the latest glibc, I am just using the
default one on my Ubuntu 16.04 system.  Maybe my test case is bad?
If so, I don't see where the problem is.

Steve Ellcey
sellcey@cavium.com

x86 with -m64 prints:

fd = 3
val(1) = 0
val(2) = 40
val(3) = 0
val(4) = 40
val(5) = 0


x86 with -mx32 prints:

fd = 3
val(1) = 0
val(2) = 40
val(3) = 0
val(4) = 0
Gee, let's write something in the file!

fu�
41
val(5) = 0


Maybe my test case is bogus but I am not sure why.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 1027 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170221/adcf0b28/attachment.bin>


More information about the Libc-alpha mailing list