[PATCH v2 24/46] ftruncate: Use ftruncate64 if arch does not have the ftruncate syscall
Markos Chandras
markos.chandras at gmail.com
Mon Nov 26 14:24:06 UTC 2012
From: Markos Chandras <markos.chandras at imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
libc/sysdeps/linux/common/ftruncate.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libc/sysdeps/linux/common/ftruncate.c b/libc/sysdeps/linux/common/ftruncate.c
index 3bdef3f..72f86f9 100644
--- a/libc/sysdeps/linux/common/ftruncate.c
+++ b/libc/sysdeps/linux/common/ftruncate.c
@@ -11,5 +11,14 @@
#include <unistd.h>
+#if defined(__NR_ftruncate64) && !defined(__NR_ftruncate)
+int ftruncate(int fd, __off_t length)
+{
+ return ftruncate64(fd, length);
+}
+libc_hidden_def(ftruncate);
+
+#else
_syscall2(int, ftruncate, int, fd, __off_t, length)
libc_hidden_def(ftruncate)
+#endif
--
1.8.0
More information about the uClibc
mailing list