summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/fallocate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/fallocate.c')
-rw-r--r--libc/sysdeps/linux/common/fallocate.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/libc/sysdeps/linux/common/fallocate.c b/libc/sysdeps/linux/common/fallocate.c
index b2309e978..0f80fb4c2 100644
--- a/libc/sysdeps/linux/common/fallocate.c
+++ b/libc/sysdeps/linux/common/fallocate.c
@@ -18,28 +18,20 @@
extern __typeof(fallocate) __libc_fallocate attribute_hidden;
int attribute_hidden __libc_fallocate(int fd, int mode, __off_t offset, __off_t len)
{
- int ret;
-
# if __WORDSIZE == 32
- uint32_t off_low = offset;
- uint32_t len_low = len;
- /* may assert that these >>31 are 0 */
- uint32_t zero = 0;
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 6, fd, mode,
- __LONG_LONG_PAIR (zero, off_low),
- __LONG_LONG_PAIR (zero, len_low)));
+ return fallocate64(fd, mode, offset, len);
# elif __WORDSIZE == 64
+ int ret;
INTERNAL_SYSCALL_DECL(err);
ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, mode, offset, len));
-# else
-# error your machine is neither 32 bit or 64 bit ... it must be magical
-# endif
if (unlikely(INTERNAL_SYSCALL_ERROR_P (ret, err))) {
__set_errno(INTERNAL_SYSCALL_ERRNO (ret, err));
ret = -1;
}
return ret;
+# else
+# error your machine is neither 32 bit or 64 bit ... it must be magical
+# endif
}
# if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU