aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/pread64.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/pread64.c')
-rw-r--r--sysdeps/mach/hurd/pread64.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sysdeps/mach/hurd/pread64.c b/sysdeps/mach/hurd/pread64.c
index 7683e29..e14416e 100644
--- a/sysdeps/mach/hurd/pread64.c
+++ b/sysdeps/mach/hurd/pread64.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_pread64 (int fd, void *buf, size_t nbytes, off64_t offset)
{
- error_t err;
- if (offset < 0)
- err = EINVAL;
- else
- err = HURD_FD_USE (fd, _hurd_fd_read (descriptor, buf, &nbytes, offset));
- return err ? __hurd_dfail (fd, err) : nbytes;
+ ssize_t ret;
+ int cancel_oldtype = LIBC_CANCEL_ASYNC();
+ ret = __pread64_nocancel (fd, buf, nbytes, offset);
+ LIBC_CANCEL_RESET (cancel_oldtype);
+ return ret;
}
#ifndef __libc_pread64