diff mbox

Fix lseek64 for aarch64 ILP32

Message ID mvm1tibboep.fsf@hawking.suse.de
State New, archived
Headers show

Commit Message

Andreas Schwab May 20, 2015, 9:15 a.m. UTC
This is needed on top of
https://sourceware.org/ml/libc-alpha/2014-10/msg00596.html and
http://sourceware.org/ml/libc-alpha/2015-03/msg00586.html to fix the
return value of lseek64 in the error case.  Without this change it
returns 0xffffffff instead of -1.

Andreas.

	* sysdeps/unix/sysv/linux/aarch64/sysdep.c (__syscall_error):
	Change return type to __SYSCALL_SLONG_TYPE.

Comments

Joseph Myers May 20, 2015, 3:58 p.m. UTC | #1
On Wed, 20 May 2015, Andreas Schwab wrote:

> This is needed on top of
> https://sourceware.org/ml/libc-alpha/2014-10/msg00596.html and
> http://sourceware.org/ml/libc-alpha/2015-03/msg00586.html to fix the
> return value of lseek64 in the error case.  Without this change it
> returns 0xffffffff instead of -1.

Is there an existing testcase in the glibc testsuite that would have 
failed for this issue, given the AArch64 ILP32 patches without this extra 
patch?  If not, could one be added?

There's a large pile of AArch64 ILP32 patches in patchwork.  Some had 
review comments from various people and need revision, but I think a lot 
may not have been reviewed (and some may be waiting for kernel changes to 
go in before anything can happen).
Andreas Schwab May 21, 2015, 3:18 p.m. UTC | #2
Joseph Myers <joseph@codesourcery.com> writes:

> Is there an existing testcase in the glibc testsuite that would have 
> failed for this issue, given the AArch64 ILP32 patches without this extra 
> patch?

Yes, libio/bug-fseek.

Andreas.
diff mbox

Patch

diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.c b/sysdeps/unix/sysv/linux/aarch64/sysdep.c
index a50e847..e49c922 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sysdep.c
+++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.c
@@ -19,12 +19,12 @@ 
 #include <sysdep.h>
 #include <errno.h>
 
-long __syscall_error (long err);
+__SYSCALL_SLONG_TYPE __syscall_error (long err);
 hidden_proto (__syscall_error)
 
 /* This routine is jumped to by all the syscall handlers, to stash
    an error number into errno.  */
-long
+__SYSCALL_SLONG_TYPE
 __syscall_error (long err)
 {
   __set_errno (- err);