about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-06-27 23:35:23 +0000
committerMark Kettenis <kettenis@gnu.org>2001-06-27 23:35:23 +0000
commit59a3de2d4e6cda168396b003618880e456a69305 (patch)
tree83ad1efd5a85ede833bc9b24edaad9b94db6deb4
parente17f38594ffd9930d2db881673373ddcf97b0f6a (diff)
downloadglibc-59a3de2d4e6cda168396b003618880e456a69305.tar.gz
glibc-59a3de2d4e6cda168396b003618880e456a69305.tar.xz
glibc-59a3de2d4e6cda168396b003618880e456a69305.zip
* sysdeps/mach/hurd/read.c: Include <hurd/fd.h>. (__libc_read): Don't call __pread. Use _hurd_fd_read directly instead. * sysdeps/mach/hurd/write.c: Include <hurd/fd.h>. (__libc_write): Don't call __pwrite. Use _hurd_fd_write directly instead.
	* sysdeps/mach/hurd/read.c: Include <hurd/fd.h>.
	(__libc_read): Don't call __pread.  Use _hurd_fd_read directly
	instead.
	* sysdeps/mach/hurd/write.c: Include <hurd/fd.h>.
	(__libc_write): Don't call __pwrite.  Use _hurd_fd_write directly
	instead.
-rw-r--r--ChangeLog7
-rw-r--r--sysdeps/mach/hurd/read.c6
-rw-r--r--sysdeps/mach/hurd/write.c7
3 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 197e18f107..c795869718 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2001-06-28  Mark Kettenis  <kettenis@gnu.org>
 
+	* sysdeps/mach/hurd/read.c: Include <hurd/fd.h>.
+	(__libc_read): Don't call __pread.  Use _hurd_fd_read directly
+	instead.
+	* sysdeps/mach/hurd/write.c: Include <hurd/fd.h>.
+	(__libc_write): Don't call __pwrite.  Use _hurd_fd_write directly
+	instead.
+
 	* sysdeps/mach/hurd/Makefile ($(link-rpcuserlibs)): Add back
 	-Wl,-soname option lost in 2001-06-16 change.
 
diff --git a/sysdeps/mach/hurd/read.c b/sysdeps/mach/hurd/read.c
index 2d504968d8..dd723af755 100644
--- a/sysdeps/mach/hurd/read.c
+++ b/sysdeps/mach/hurd/read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,94,95,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1993,94,95,97,98,99,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,12 +18,14 @@
 
 #include <errno.h>
 #include <unistd.h>
+#include <hurd/fd.h>
 
 /* Read NBYTES into BUF from FD.  Return the number read or -1.  */
 ssize_t
 __libc_read (int fd, void *buf, size_t nbytes)
 {
-  return __pread (fd, buf, nbytes, (off_t) -1);
+  error_t err = HURD_FD_USE (fd, _hurd_fd_read (descriptor, buf, &nbytes, -1));
+  return err ? __hurd_dfail (fd, err) : nbytes;
 }
 
 weak_alias (__libc_read, __read)
diff --git a/sysdeps/mach/hurd/write.c b/sysdeps/mach/hurd/write.c
index e9d8c9d539..14c4522180 100644
--- a/sysdeps/mach/hurd/write.c
+++ b/sysdeps/mach/hurd/write.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,97,98,99 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,97,98,99,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -18,11 +18,14 @@
 
 #include <errno.h>
 #include <unistd.h>
+#include <hurd/fd.h>
 
 ssize_t
 __libc_write (int fd, const void *buf, size_t nbytes)
 {
-  return __pwrite (fd, buf, nbytes, (off_t) -1);
+  error_t err = HURD_FD_USE (fd, _hurd_fd_write (descriptor,
+						 buf, &nbytes, -1));
+  return err ? __hurd_dfail (fd, err) : nbytes;
 }
 
 weak_alias (__libc_write, __write)