From 3bf231c5db32b6ac3e4b957ed8c2fd7cf580530d Mon Sep 17 00:00:00 2001 From: mbm Date: Sat, 31 Jul 2004 02:02:39 +0000 Subject: [PATCH] andersee's ftruncate patch git-svn-id: svn://svn.openwrt.org/openwrt/trunk@117 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../sources/uClibc-ftruncate.patch | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 obsolete-buildroot/sources/uClibc-ftruncate.patch diff --git a/obsolete-buildroot/sources/uClibc-ftruncate.patch b/obsolete-buildroot/sources/uClibc-ftruncate.patch new file mode 100644 index 000000000..50b4f20de --- /dev/null +++ b/obsolete-buildroot/sources/uClibc-ftruncate.patch @@ -0,0 +1,70 @@ +--- uClibc/libc/sysdeps/linux/common/ftruncate64.c 17 Nov 2003 01:24:07 -0000 1.10 ++++ uClibc/libc/sysdeps/linux/common/ftruncate64.c 21 Jul 2004 07:13:38 -0000 +@@ -23,7 +23,7 @@ + + #if defined __NR_ftruncate64 + +-#if __WORDSIZE == 64 || (defined(__powerpc__) && defined (__UCLIBC_HAS_LFS__)) ++#if __WORDSIZE == 64 + + /* For a 64 bit machine, life is simple... */ + _syscall2(int, ftruncate64, int, fd, __off64_t, length); +@@ -33,15 +33,25 @@ + #ifndef INLINE_SYSCALL + #define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args) + #define __NR___syscall_ftruncate64 __NR_ftruncate64 ++#if defined(__powerpc__) || defined(__mips__) ++static inline _syscall4(int, __syscall_ftruncate64, int, fd, int, pad, int, high_length, int, low_length); ++#else + static inline _syscall3(int, __syscall_ftruncate64, int, fd, int, high_length, int, low_length); + #endif ++#endif + + /* The exported ftruncate64 function. */ + int ftruncate64 (int fd, __off64_t length) + { + uint32_t low = length & 0xffffffff; + uint32_t high = length >> 32; +- return INLINE_SYSCALL(ftruncate64, 3, fd, __LONG_LONG_PAIR (high, low)); ++ return INLINE_SYSCALL(ftruncate64, ++#if defined(__powerpc__) || defined(__mips__) ++ 4, fd, 0, ++#else ++ 3, fd, ++#endif ++ __LONG_LONG_PAIR (high, low)); + } + + #else /* __WORDSIZE */ +--- uClibc/libc/sysdeps/linux/common/truncate64.c 15 Nov 2002 14:06:44 -0000 1.8 ++++ uClibc/libc/sysdeps/linux/common/truncate64.c 21 Jul 2004 07:13:38 -0000 +@@ -33,7 +33,13 @@ + #ifndef INLINE_SYSCALL + #define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64 (args) + #define __NR___syscall_truncate64 __NR_truncate64 +-static inline _syscall3(int, __syscall_truncate64, const char *, path, int, high_length, int, low_length); ++#if defined(__powerpc__) || defined(__mips__) ++static inline _syscall4(int, __syscall_truncate64, const char *, path, ++ int, pad, int, high_length, int, low_length); ++#else ++static inline _syscall3(int, __syscall_truncate64, const char *, path, ++ int, high_length, int, low_length); ++#endif + #endif + + +@@ -42,7 +48,13 @@ + { + uint32_t low = length & 0xffffffff; + uint32_t high = length >> 32; +- return INLINE_SYSCALL(truncate64, 3, path, __LONG_LONG_PAIR (high, low)); ++ return INLINE_SYSCALL(truncate64, ++#if defined(__powerpc__) || defined(__mips__) ++ 4, path, 0, ++#else ++ 3, path, ++#endif ++ __LONG_LONG_PAIR (high, low)); + } + #endif /* __UCLIBC_HAS_LFS__ */ + -- 2.20.1