diff options
Diffstat (limited to 'libc/sysdeps/linux/common/open64.c')
-rw-r--r-- | libc/sysdeps/linux/common/open64.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index 91931fa70..bbb12cd1a 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -7,47 +7,24 @@ #include <_lfs_64.h> #include <fcntl.h> #include <stdarg.h> -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -#include <errno.h> -#include <sysdep-cancel.h> -#endif - -#ifndef O_LARGEFILE -# define O_LARGEFILE 0100000 -#endif +#include <cancel.h> /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, a third argument is the file protection. */ -int open64 (const char *file, int oflag, ...) +int open64(const char *file, int oflag, ...) { - mode_t mode = 0; - - if (oflag & O_CREAT) - { - va_list arg; - va_start (arg, oflag); - mode = va_arg (arg, mode_t); - va_end (arg); - } - -#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); + mode_t mode = 0; - LIBC_CANCEL_RESET (oldtype); + if (oflag & O_CREAT) { + va_list arg; + va_start (arg, oflag); + mode = va_arg (arg, mode_t); + va_end (arg); + } - return result; -#else - return open(file, oflag | O_LARGEFILE, mode); -#endif + return open(file, oflag | O_LARGEFILE, mode); } -#ifndef __LINUXTHREADS_OLD__ -libc_hidden_def(open64) -#else -libc_hidden_weak(open64) -strong_alias(open64,__libc_open64) -#endif +lt_strong_alias(open64) +lt_libc_hidden(open64) +/* open handled cancellation, noop on uClibc */ +LIBC_CANCEL_HANDLED(); |