From 57e8823548ad6e65d33b2153edeb18fb0edc20e6 Mon Sep 17 00:00:00 2001 From: Austin Foxley Date: Sat, 17 Oct 2009 14:32:36 -0700 Subject: cancellation support for a large amount of the required syscalls Signed-off-by: Austin Foxley --- libc/sysdeps/linux/common/open64.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps/linux/common/open64.c') diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index cfe471c64..c1f5400b8 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -7,6 +7,10 @@ #include #include #include +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +#include +#include +#endif #ifdef __UCLIBC_HAS_LFS__ @@ -28,7 +32,20 @@ int open64 (const char *file, int oflag, ...) va_end (arg); } - return open(file, oflag | O_LARGEFILE, mode); +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ + if (SINGLE_THREAD_P) + return INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode); + + LIBC_CANCEL_RESET (oldtype); + + return result; +#else + return open(file, oflag | O_LARGEFILE, mode); +#endif } #ifndef __LINUXTHREADS_OLD__ libc_hidden_def(open64) -- cgit v1.2.3