summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-11-25 18:01:02 +0100
committerJim Meyering <meyering@redhat.com>2009-11-25 18:01:02 +0100
commit23cd74133c81b80d335c701848b71d85a53402c6 (patch)
tree34bbf11889f0c045dc32367bf3df77b47d1e2fe4
parent8def010e77c2bace5391a1cda45e158d9e0a3f7d (diff)
downloadgnulib-23cd74133c81b80d335c701848b71d85a53402c6.tar.gz
pread: improvement and fix
* modules/pread (Depends-on): Depend on lseek, for portability to e.g., mingw. Suggested by Eric Blake. * lib/pread.c (__libc_read): Define. Reported by Richard W.M. Jones.
-rw-r--r--ChangeLog5
-rw-r--r--lib/pread.c1
-rw-r--r--modules/pread1
3 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6128785ab9..2e5f9fbe61 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-11-25 Jim Meyering <meyering@redhat.com>
+ pread: improvement and fix
+ * modules/pread (Depends-on): Depend on lseek, for portability to
+ e.g., mingw. Suggested by Eric Blake.
+ * lib/pread.c (__libc_read): Define. Reported by Richard W.M. Jones.
+
unistd.in.h: correct declaration of pread
* lib/unistd.in.h: Correct type of "buf" parameter: void*, not char*
Reported by Richard W.M. Jones.
diff --git a/lib/pread.c b/lib/pread.c
index 632b91497c..7094ea7d08 100644
--- a/lib/pread.c
+++ b/lib/pread.c
@@ -23,6 +23,7 @@
#define __libc_lseek(f,o,w) lseek (f, o, w)
#define __set_errno(Val) errno = (Val)
+#define __libc_read(f,b,n) read (f, b, n)
/* pread substitute for systems that the function, such as mingw32 and BeOS. */
/* The following is identical to the function from glibc's
diff --git a/modules/pread b/modules/pread
index 06039e64dd..4fb442467f 100644
--- a/modules/pread
+++ b/modules/pread
@@ -6,6 +6,7 @@ lib/pread.c
m4/pread.m4
Depends-on:
+lseek
unistd
configure.ac: