]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* string/endian.h (__LONG_LONG_PAIR): New macro.
authorGreg McGary <greg@mcgary.org>
Thu, 6 Jul 2000 23:42:33 +0000 (23:42 +0000)
committerGreg McGary <greg@mcgary.org>
Thu, 6 Jul 2000 23:42:33 +0000 (23:42 +0000)
* sysdeps/unix/sysv/linux/ftruncate64.c: Use it.
* sysdeps/unix/sysv/linux/pread.c: Likewise.
* sysdeps/unix/sysv/linux/pread64.c: Likewise.
* sysdeps/unix/sysv/linux/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
* sysdeps/unix/sysv/linux/truncate64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/ftruncate64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pread.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pread64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite64.c: Likewise.
* sysdeps/unix/sysv/linux/mips/truncate64.c: Likewise.

sysdeps/unix/sysv/linux/mips/ftruncate64.c
sysdeps/unix/sysv/linux/mips/pread.c
sysdeps/unix/sysv/linux/mips/pread64.c
sysdeps/unix/sysv/linux/mips/pwrite.c
sysdeps/unix/sysv/linux/mips/pwrite64.c
sysdeps/unix/sysv/linux/mips/truncate64.c

index 768946e9fa9634e80980d6430047a3e933510ae5..e45afbad7d47f8486a5d1550ad04f33e6a359d5f 100644 (file)
@@ -50,13 +50,8 @@ ftruncate64 (int fd, off64_t length)
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       int saved_errno = errno;
 #endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-      /* Use a fill argument to pass low, high in an aligned pair of
-         arguments (here 2/3).  */
-      int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, low, high);
-#elif __BYTE_ORDER == __BIG_ENDIAN
-      int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0, high, low);
-#endif
+      int result = INLINE_SYSCALL (ftruncate64, 3, fd, 0,
+                                  __LONG_LONG_PAIR (high, low));
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       if (result != -1 || errno != ENOSYS)
 #endif
index d926a06508290eaad43f2f4ac1e79224248310f1..dd1e5d8a0567a3e4ca82567909e55f91b038fdfa 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <unistd.h>
+#include <endian.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>
@@ -46,11 +47,8 @@ __libc_pread (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-# if defined(__MIPSEB__)
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, 0, offset);
-# elif defined(__MIPSEL__)
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, offset, 0);
-# endif
+  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
+                          __LONG_LONG_PAIR (0, offset));
 # if __ASSUME_PREAD_SYSCALL == 0
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
index d17dbeb39671d31d6227a3b236b55e0e7d4844d3..06a992e1cbd051421c7a11ee62956289d6799e92 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <unistd.h>
+#include <endian.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>
@@ -47,14 +48,9 @@ __libc_pread64 (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-# if defined(__MIPSEB__)
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, (off_t) (offset >> 32),
-                          (off_t) (offset & 0xffffffff));
-# elif defined(__MIPSEL__)
   result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                          (off_t) (offset & 0xffffffff),
-                          (off_t) (offset >> 32));
-# endif
+                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                            (off_t) (offset & 0xffffffff)));
 # if __ASSUME_PREAD_SYSCALL == 0
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
index a83df31ca4e1ce2752af6bafd7fa0fbeee6b2dd7..b45bb84f4db0244ee763484d16870dc25cc3decd 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <unistd.h>
+#include <endian.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>
@@ -45,11 +46,8 @@ __libc_pwrite (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-# if defined(__MIPSEB__)
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, 0, offset);
-# elif defined(__MIPSEL__)
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, offset, 0);
-# endif
+  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
+                          __LONG_LONG_PAIR (0, offset));
 # if __ASSUME_PWRITE_SYSCALL == 0
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
index 295a1754b67de2ee3a10331bb1543afa5d1a55c4..04810645001ce29fbfe09adc4adf8724da2e4d9f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <unistd.h>
+#include <endian.h>
 
 #include <sysdep.h>
 #include <sys/syscall.h>
@@ -45,15 +46,9 @@ __libc_pwrite64 (fd, buf, count, offset)
   ssize_t result;
 
   /* First try the syscall.  */
-# if defined(__MIPSEB__)
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, (off_t) (offset >> 32),
-                          (off_t) (offset & 0xffffffff));
-# elif defined(__MIPSEL__)
   result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                          (off_t) (offset & 0xffffffff),
-                          (off_t) (offset >> 32));
-# endif
-
+                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                            (off_t) (offset & 0xffffffff)));
 # if __ASSUME_PWRITE_SYSCALL == 0
   if (result == -1 && errno == ENOSYS)
     /* No system call available.  Use the emulation.  */
index bcdb9ddf98184276b3126c5e5d3b6e0d0fffbffd..7a446194d311bf8e766a4071db7c5b02fff58bc4 100644 (file)
@@ -50,14 +50,8 @@ truncate64 (const char *path, off64_t length)
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       int saved_errno = errno;
 #endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-      /* Use a fill argument to pass low, high in an aligned pair of
-         arguments (here 2/3).  */
-      int result = INLINE_SYSCALL (truncate64, 3, path, 0, low, high);
-#elif __BYTE_ORDER == __BIG_ENDIAN
-      int result = INLINE_SYSCALL (truncate64, 3, path, 0, high, low);
-#endif
-
+      int result = INLINE_SYSCALL (truncate64, 3, path, 0,
+                                  __LONG_LONG_PAIR (high, low));
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       if (result != -1 || errno != ENOSYS)
 #endif