This is the mail archive of the 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] [BZ #19371] Properly handle x32 syscall

On Wed, Dec 16, 2015 at 07:01:39AM -0800, H.J. Lu wrote:
> X32 syscall() may return 64-bit integer as lseek, time and times.  Its
> return type should be __syscall_slong_t instead of long int.  We need
> to properly return 64-bit error value.
> +#include <sysdep.h>
> +
> +/* Return -1LL in a full 64 bits.  */
> +0:				\
> +	orq $-1, %rax;		\
> +	ret;
> +
> +/* Always use our own error handler.  */
> +
> +#include <sysdeps/unix/sysv/linux/x86_64/syscall.S>

While this looks technically OK, I don't understand why RAX_LP is used
at all in default SYSCALL_ERROR_HANDLER in place for rax.  Everything
would be simpler if glibc finally admitted that return code of any
x32 linux syscall is stored in %rax and not in %eax.

Also, I wish this and times bugs were fixed long time ago.
Now I have to apply workarounds like this:


Attachment: pgpKYKIcVtwSH.pgp
Description: PGP signature

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