From 1869e7d1341a3c01b5aa0d231e4708c35e374b83 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 26 May 2000 20:11:43 +0000 Subject: * sysdeps/unix/sysv/linux/ftruncate64.c (ftruncate64): Make order of arguments dependend on endianness. * sysdeps/unix/sysv/linux/truncate64.c: Likewise. --- sysdeps/unix/sysv/linux/truncate64.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sysdeps/unix/sysv/linux/truncate64.c') diff --git a/sysdeps/unix/sysv/linux/truncate64.c b/sysdeps/unix/sysv/linux/truncate64.c index 2f8d5a38e2..e921442021 100644 --- a/sysdeps/unix/sysv/linux/truncate64.c +++ b/sysdeps/unix/sysv/linux/truncate64.c @@ -17,6 +17,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include #include @@ -31,14 +32,13 @@ int __have_no_truncate64; #endif +/* The order of hight, low depends on endianness. */ extern int __syscall_truncate64 (const char *path, int high_length, int low_length); /* Truncate the file FD refers to to LENGTH bytes. */ int -truncate64 (path, length) - const char *path; - off64_t length; +truncate64 (const char *path, off64_t length) { #ifndef __ASSUME_TRUNCATE64_SYSCALL if (! __have_no_truncate64) @@ -49,7 +49,11 @@ truncate64 (path, length) #ifndef __ASSUME_TRUNCATE64_SYSCALL int saved_errno = errno; #endif +#if __BYTE_ORDER == __LITTLE_ENDIAN int result = INLINE_SYSCALL (truncate64, 3, path, low, high); +#elif __BYTE_ORDER == __BIG_ENDIAN + int result = INLINE_SYSCALL (truncate64, 3, path, high, low); +#endif #ifndef __ASSUME_TRUNCATE64_SYSCALL if (result != -1 || errno != ENOSYS) -- cgit 1.4.1