This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add Linux/x32 sysdep.h


> Leaving out SYSCALL_RETURN_INT64 makes is impossible to test
> the change on Linux/x32.

It only leaves lseek broken.  Everything else will be fine.
But if you prefer, we can do lseek first instead.

It's really just more obfuscation to use syscall-template.S for that.
What I'd do is just write it out:

/* lseek system call stub for Linux/x32.
   Copyright ...
*/

#include <sysdep-cancel.h>

/* Comment about why this is needed at all.  */

#undef	SYSCALL_ERROR_LABEL
#define SYSCALL_ERROR_LABEL 0f
PSEUDO (__libc_lseek64, lseek, 3)
	ret
0:

Then modify x86_64/sysdep.h so it defines a macro SYSCALL_SET_ERRNO
that is just the part of SYSCALL_ERROR_HANDLER after the label and
before setting %rax.  Then it's:

0:	SYSCALL_SET_ERRNO
	orq $-1, %rax	/* Return -1LL in a full 64 bits.  */
	ret

You can do the break-out of the SYSCALL_SET_ERRNO macro and the addition of
x32/llseek.S in one change.  Then you can make the existing sysdep.h macros
uses R*_LP macros in a second change.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]