nice: return EPERM instead of EACCES
[musl] / src / unistd / ftruncate.c
index e0b2f4b..b41be0f 100644 (file)
@@ -1,15 +1,9 @@
 #include <unistd.h>
 #include "syscall.h"
-#include "libc.h"
 
 int ftruncate(int fd, off_t length)
 {
-       if (sizeof(long) == 8)
-               return syscall2(__NR_ftruncate, fd, length);
-       else {
-               union { long long ll; long l[2]; } u = { length };
-               return syscall3(__NR_ftruncate64, fd, u.l[0], u.l[1]);
-       }
+       return syscall(SYS_ftruncate, fd, __SYSCALL_LL_O(length));
 }
 
-LFS64(ftruncate);
+weak_alias(ftruncate, ftruncate64);