From: Szabolcs Nagy Date: Thu, 14 Jul 2022 13:22:26 +0000 (+0100) Subject: TODO(api): cheri: fix syscall return type X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9733f57ff3f664c735dbe15f4839c534aeecf41c;p=thirdparty%2Fglibc.git TODO(api): cheri: fix syscall return type TODO: this affects API (syscall return type is long) so breaks portability and requires doc updates. --- diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h index 3dc2bad50e2..83f2323eda7 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; \