aboutsummaryrefslogtreecommitdiff
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-10-27 14:46:50 +0100
commit9733f57ff3f664c735dbe15f4839c534aeecf41c (patch)
tree0dca634374647bfc37cffbd2a965ac9b3bc74bf7
parent12eeeae444d2d35ec77d325809db773742f896b6 (diff)
downloadglibc-9733f57ff3f664c735dbe15f4839c534aeecf41c.tar
glibc-9733f57ff3f664c735dbe15f4839c534aeecf41c.tar.gz
glibc-9733f57ff3f664c735dbe15f4839c534aeecf41c.tar.bz2
glibc-9733f57ff3f664c735dbe15f4839c534aeecf41c.zip
TODO(api): cheri: fix syscall return type
TODO: this affects API (syscall return type is long) so breaks portability and requires doc updates.
-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; \