summaryrefslogtreecommitdiffstats
path: root/obsolete-buildroot/sources/uClibc-ftruncate.patch
blob: 50b4f20defd42f0f46b3a61354f159242d50bb8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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__ */