summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/mips')
-rw-r--r--libc/sysdeps/linux/mips/pread_write.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/libc/sysdeps/linux/mips/pread_write.c b/libc/sysdeps/linux/mips/pread_write.c
index 3ae4a98b7..0fa6c024c 100644
--- a/libc/sysdeps/linux/mips/pread_write.c
+++ b/libc/sysdeps/linux/mips/pread_write.c
@@ -12,20 +12,7 @@
* from GNU libc 2.2.5, but reworked considerably...
*/
-#define _GNU_SOURCE
-#define _LARGEFILE64_SOURCE
-#include <features.h>
-#undef __OPTIMIZE__
-/* We absolutely do _NOT_ want interfaces silently
- * * * renamed under us or very bad things will happen... */
-#ifdef __USE_FILE_OFFSET64
-# undef __USE_FILE_OFFSET64
-#endif
-
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
+#include "../common/syscalls.h"
#include <unistd.h>
#include <stdint.h>
@@ -38,10 +25,10 @@
#ifdef __NR_pread
-#ifdef __mips64
+# ifdef __mips64
_syscall4(ssize_t, pread, int, fd, void *, buf, size_t, count, off_t, offset);
-#else /* !__mips64 */
-#define __NR___syscall_pread __NR_pread
+# else /* !__mips64 */
+# define __NR___syscall_pread __NR_pread
static inline _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf,
size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo);
@@ -51,7 +38,7 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
}
strong_alias(__libc_pread,pread)
-#if defined __UCLIBC_HAS_LFS__
+# ifdef __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
{
uint32_t low = offset & 0xffffffff;
@@ -59,8 +46,8 @@ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
}
strong_alias(__libc_pread64,pread64)
-#endif /* __UCLIBC_HAS_LFS__ */
-#endif /* !__mips64 */
+# endif /* __UCLIBC_HAS_LFS__ */
+# endif /* !__mips64 */
#endif /* __NR_pread */
@@ -75,10 +62,10 @@ strong_alias(__libc_pread64,pread64)
#ifdef __NR_pwrite
-#ifdef __mips64
+# ifdef __mips64
_syscall4(ssize_t, pwrite, int, fd, const void *, buf, size_t, count, off_t, offset);
-#else /* !__mips64 */
-#define __NR___syscall_pwrite __NR_pwrite
+# else /* !__mips64 */
+# define __NR___syscall_pwrite __NR_pwrite
static inline _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo);
@@ -88,7 +75,7 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
}
strong_alias(__libc_pwrite,pwrite)
-#if defined __UCLIBC_HAS_LFS__
+# ifdef __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
{
uint32_t low = offset & 0xffffffff;
@@ -96,6 +83,6 @@ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
}
strong_alias(__libc_pwrite64,pwrite64)
-#endif /* __UCLIBC_HAS_LFS__ */
-#endif /* !__mips64 */
+# endif /* __UCLIBC_HAS_LFS__ */
+# endif /* !__mips64 */
#endif /* __NR_pwrite */