r23363: Activate rep_pread and rep_pwrite in lib/replace/replace.h.
authorMichael Adam <obnox@samba.org>
Wed, 6 Jun 2007 09:27:43 +0000 (09:27 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:10 +0000 (12:23 -0500)
This fixes the build on a SuSE 6.1. :-)
I guess this had been merely forgotten.

But beware: The implementations of rep_pread and rep_pwrite are
not thread safe.

Michael

source/lib/replace/replace.c
source/lib/replace/replace.h

index 87e73d001c1e063ce190bd9a55729601057cb430..b86da53cafd6c609d9afbf92b9fb6e00199df835 100644 (file)
@@ -438,6 +438,10 @@ char *rep_mkdtemp(char *template)
 }
 #endif
 
+/*****************************************************************
+ Watch out: this is not thread safe.
+*****************************************************************/
+
 #ifndef HAVE_PREAD
 ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset)
 {
@@ -448,6 +452,10 @@ ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset)
 }
 #endif
 
+/*****************************************************************
+ Watch out: this is not thread safe.
+*****************************************************************/
+
 #ifndef HAVE_PWRITE
 ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
 {
index f584cd42fabeb1b1ef6c468eff7c091ce1b058a2..62d480e20efb7198e6ca669ccc5ceb4380bae8ed 100644 (file)
@@ -350,6 +350,16 @@ int rep_mkstemp(char *temp);
 char *rep_mkdtemp(char *template);
 #endif
 
+#ifndef HAVE_PREAD
+#define pread rep_pread
+ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset);
+#endif
+
+#ifndef HAVE_PWRITE
+#define pwrite rep_pwrite
+ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset);
+#endif
+
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif