summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysdep.h')
-rw-r--r--sysdeps/unix/sysdep.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index aac93039de..29c39618c2 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -102,6 +102,22 @@
sc_ret; \
})
+/* Issue a syscall defined by syscall number plus any other argument
+ required. Any error will be returned unmodified (including errno). */
+#define INTERNAL_SYSCALL_CANCEL(...) \
+ ({ \
+ long int sc_ret; \
+ if (SINGLE_THREAD_P) \
+ sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \
+ else \
+ { \
+ int sc_cancel_oldtype = LIBC_CANCEL_ASYNC (); \
+ sc_ret = INTERNAL_SYSCALL_CALL (__VA_ARGS__); \
+ LIBC_CANCEL_RESET (sc_cancel_oldtype); \
+ } \
+ sc_ret; \
+ })
+
/* Machine-dependent sysdep.h files are expected to define the macro
PSEUDO (function_name, syscall_name) to emit assembly code to define the
C-callable function FUNCTION_NAME to do system call SYSCALL_NAME.