]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
TODO(api): cheri: fix syscall return type
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 14 Jul 2022 13:22:26 +0000 (14:22 +0100)
committerSzabolcs Nagy <szabolcs.nagy@arm.com>
Thu, 27 Oct 2022 13:46:50 +0000 (14:46 +0100)
TODO: this affects API (syscall return type is long)
so breaks portability and requires doc updates.

sysdeps/unix/sysv/linux/sysdep.h

index 3dc2bad50e22488ee2b9df82494b5259c230d373..83f2323eda734868c2c36ff17915c021019476fd 100644 (file)
   })
 #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;                                                          \