[PATCH 24/46] truncate: Use truncate64 if arch does not have the truncate syscall

Markos Chandras markos.chandras at gmail.com
Tue Nov 13 11:31:33 UTC 2012


From: Markos Chandras <markos.chandras at imgtec.com>

Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
 libc/sysdeps/linux/common/truncate.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/common/truncate.c b/libc/sysdeps/linux/common/truncate.c
index 2331bdd..727db12 100644
--- a/libc/sysdeps/linux/common/truncate.c
+++ b/libc/sysdeps/linux/common/truncate.c
@@ -11,5 +11,14 @@
 #include <unistd.h>
 
 
+#if defined(__NR_truncate64) && ! defined(__NR_truncate)
+int truncate(const char* path, __off_t length)
+{
+	return truncate64(path, length);
+}
+libc_hidden_def(truncate);
+
+#else
 _syscall2(int, truncate, const char *, path, __off_t, length)
 libc_hidden_def(truncate)
+#endif
-- 
1.7.1




More information about the uClibc mailing list