diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/pwrite64.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/pwrite64.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c index dc81cd6b31..91f48951b0 100644 --- a/sysdeps/unix/sysv/linux/pwrite64.c +++ b/sysdeps/unix/sysv/linux/pwrite64.c @@ -21,7 +21,7 @@ #include <endian.h> #include <unistd.h> -#include <sysdep.h> +#include <sysdep-cancel.h> #include <sys/syscall.h> #include <bp-checks.h> @@ -45,12 +45,8 @@ static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count, # endif -ssize_t -__libc_pwrite64 (fd, buf, count, offset) - int fd; - const void *buf; - size_t count; - off64_t offset; +static ssize_t +do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) { ssize_t result; @@ -67,6 +63,26 @@ __libc_pwrite64 (fd, buf, count, offset) return result; } + +ssize_t +__libc_pwrite64 (fd, buf, count, offset) + int fd; + const void *buf; + size_t count; + off64_t offset; +{ + if (SINGLE_THREAD_P) + return do_pwrite64 (fd, buf, count, offset); + + int oldtype = LIBC_CANCEL_ASYNC (); + + ssize_t result = do_pwrite64 (fd, buf, count, offset); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} + weak_alias (__libc_pwrite64, __pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) |