about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-07-14 14:22:26 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-11-22 14:31:25 +0000
commite1a82e398439df8fbdb33faf540f91fd68de3c20 (patch)
treec3c605c358d14667e29ba5b6e0cb79d066fa2256 /sysdeps/unix/sysv/linux
parent2d432f9815d6666cd6a22c263fc3de999c1e00c2 (diff)
downloadglibc-e1a82e398439df8fbdb33faf540f91fd68de3c20.tar.gz
glibc-e1a82e398439df8fbdb33faf540f91fd68de3c20.tar.xz
glibc-e1a82e398439df8fbdb33faf540f91fd68de3c20.zip
TODO(api): cheri: fix syscall return type
TODO: this affects API (syscall return type is long)
so breaks portability and requires doc updates.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/sysdep.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h
index 3dc2bad50e..83f2323eda 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -35,13 +35,19 @@
   })
 #endif
 
+#ifdef __CHERI_PURE_CAPABILITY__
+# define syscall_ret_t intptr_t
+#else
+# define syscall_ret_t long
+#endif
+
 /* Define a macro which expands into the inline wrapper code for a system
    call.  It sets the errno and returns -1 on a failure, or the syscall
    return value otherwise.  */
 #undef INLINE_SYSCALL
 #define INLINE_SYSCALL(name, nr, args...)				\
   ({									\
-    long int sc_ret = INTERNAL_SYSCALL (name, nr, args);		\
+    syscall_ret_t sc_ret = INTERNAL_SYSCALL (name, nr, args);		\
     __glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (sc_ret))		\
     ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (sc_ret))		\
     : sc_ret;								\