about summary refs log tree commit diff
diff options
context:
space:
mode:
authorXing Li <lixing@loongson.cn>2022-11-29 19:24:43 +0800
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-12-07 10:37:06 -0300
commit36d423e2032e98305799071b831691fc4c06deea (patch)
treee1091f68c14fc6877a0ad8cd34af0cfd79c0e42a
parent9f482b73f41a9a1bbfb173aad0733d1c824c788a (diff)
downloadglibc-36d423e2032e98305799071b831691fc4c06deea.tar.gz
glibc-36d423e2032e98305799071b831691fc4c06deea.tar.xz
glibc-36d423e2032e98305799071b831691fc4c06deea.zip
linux: Use long int for syscall return value
The linux syscall ABI returns long, so the generic syscall code for
linux should use long for the return value.

This fixes the truncation of the return value of the syscall function
when that does not fit into an int.
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
-rw-r--r--sysdeps/unix/sysv/linux/syscall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/syscall.c b/sysdeps/unix/sysv/linux/syscall.c
index 7303ba7188..8cb0b66b1c 100644
--- a/sysdeps/unix/sysv/linux/syscall.c
+++ b/sysdeps/unix/sysv/linux/syscall.c
@@ -33,7 +33,7 @@ syscall (long int number, ...)
   long int a5 = va_arg (args, long int);
   va_end (args);
 
-  int r = INTERNAL_SYSCALL_NCS_CALL (number, a0, a1, a2, a3, a4, a5);
+  long int r = INTERNAL_SYSCALL_NCS_CALL (number, a0, a1, a2, a3, a4, a5);
   if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (r)))
     {
       __set_errno (-r);