Browse Source

Fix mips bug related to 2.6 headers by following glibc's lead. Based on
the comment, newer kernels appended "64" to __NR_pread and __NR_pwrite.

Manuel Novoa III 21 years ago
parent
commit
6ca9cc33a3
1 changed files with 15 additions and 0 deletions
  1. 15 0
      libc/sysdeps/linux/mips/pread_write.c

+ 15 - 0
libc/sysdeps/linux/mips/pread_write.c

@@ -40,6 +40,13 @@
 #include <unistd.h>
 #include <stdint.h>
 
+#ifdef __NR_pread64             /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pread
+#  error "__NR_pread and __NR_pread64 both defined???"
+# endif
+# define __NR_pread __NR_pread64
+#endif
+
 #ifdef __NR_pread
 
 #ifdef __mips64
@@ -68,6 +75,14 @@ weak_alias (__libc_pread64, pread64)
 
 #endif /* __NR_pread */
 
+/**********************************************************************/
+
+#ifdef __NR_pwrite64            /* Newer kernels renamed but it's the same.  */
+# ifdef __NR_pwrite
+#  error "__NR_pwrite and __NR_pwrite64 both defined???"
+# endif
+# define __NR_pwrite __NR_pwrite64
+#endif
 
 #ifdef __NR_pwrite