Browse Source

use hidden read/write symbols

Mike Frysinger 19 years ago
parent
commit
3ce6992e99
3 changed files with 8 additions and 4 deletions
  1. 2 0
      libc/stdio/_READ.c
  2. 2 0
      libc/stdio/_WRITE.c
  3. 4 4
      libc/sysdeps/linux/common/pread_write.c

+ 2 - 0
libc/stdio/_READ.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
  */
 
 
+#define read __read
+
 #include "_stdio.h"
 #include "_stdio.h"
 
 
 /* Given a reading stream without its end-of-file indicator set and
 /* Given a reading stream without its end-of-file indicator set and

+ 2 - 0
libc/stdio/_WRITE.c

@@ -5,6 +5,8 @@
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
  */
  */
 
 
+#define write __write
+
 #include "_stdio.h"
 #include "_stdio.h"
 
 
 /* Given a writing stream with no buffered output, write the
 /* Given a writing stream with no buffered output, write the

+ 4 - 4
libc/sysdeps/linux/common/pread_write.c

@@ -109,10 +109,10 @@ static ssize_t __fake_pread_write(int fd, void *buf,
 
 
 	if (do_pwrite==1) {
 	if (do_pwrite==1) {
 		/* Write the data.  */
 		/* Write the data.  */
-		result = write(fd, buf, count);
+		result = __write(fd, buf, count);
 	} else {
 	} else {
 		/* Read the data.  */
 		/* Read the data.  */
-		result = read(fd, buf, count);
+		result = __read(fd, buf, count);
 	}
 	}
 
 
 	/* Now we have to restore the position.  If this fails we 
 	/* Now we have to restore the position.  If this fails we 
@@ -147,10 +147,10 @@ static ssize_t __fake_pread_write64(int fd, void *buf,
 
 
 	if (do_pwrite==1) {
 	if (do_pwrite==1) {
 		/* Write the data.  */
 		/* Write the data.  */
-		result = write(fd, buf, count);
+		result = __write(fd, buf, count);
 	} else {
 	} else {
 		/* Read the data.  */
 		/* Read the data.  */
-		result = read(fd, buf, count);
+		result = __read(fd, buf, count);
 	}
 	}
 
 
 	/* Now we have to restore the position. */
 	/* Now we have to restore the position. */