diff options
Diffstat (limited to 'sysdeps/mach/hurd/pwrite64.c')
-rw-r--r-- | sysdeps/mach/hurd/pwrite64.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sysdeps/mach/hurd/pwrite64.c b/sysdeps/mach/hurd/pwrite64.c index d4f3a83982..961b231394 100644 --- a/sysdeps/mach/hurd/pwrite64.c +++ b/sysdeps/mach/hurd/pwrite64.c @@ -17,19 +17,17 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ -#include <errno.h> -#include <unistd.h> -#include <hurd/fd.h> +#include <sysdep-cancel.h> +#include <not-cancel.h> ssize_t __libc_pwrite64 (int fd, const void *buf, size_t nbytes, off64_t offset) { - error_t err; - if (offset < 0) - err = EINVAL; - else - err = HURD_FD_USE (fd, _hurd_fd_write (descriptor, buf, &nbytes, offset)); - return err ? __hurd_dfail (fd, err) : nbytes; + ssize_t ret; + int cancel_oldtype = LIBC_CANCEL_ASYNC(); + ret = __pwrite64_nocancel (fd, buf, nbytes, offset); + LIBC_CANCEL_RESET (cancel_oldtype); + return ret; } #ifndef __libc_pwrite64 |