summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/posix_fallocate.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-09-09 21:20:07 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-09-09 21:20:07 +0200
commitdef0d92193606e184d356c4d2d1752526573f87c (patch)
treeb2460ec3b5eb1f11aa1d92f8909747dae123f0b0 /libc/sysdeps/linux/common/posix_fallocate.c
parent032f47c7fd7580087d71f2e938dc4f95cc94ce92 (diff)
parent62d3a427afdea136c82bb599a18a593d9b32c533 (diff)
Merge remote-tracking branch 'origin/upstream'
Diffstat (limited to 'libc/sysdeps/linux/common/posix_fallocate.c')
-rw-r--r--libc/sysdeps/linux/common/posix_fallocate.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/libc/sysdeps/linux/common/posix_fallocate.c b/libc/sysdeps/linux/common/posix_fallocate.c
index 9aaa6ce15..76771e353 100644
--- a/libc/sysdeps/linux/common/posix_fallocate.c
+++ b/libc/sysdeps/linux/common/posix_fallocate.c
@@ -14,28 +14,10 @@
#include <stdint.h>
#if defined __NR_fallocate
+extern __typeof(fallocate) __libc_fallocate attribute_hidden;
int posix_fallocate(int fd, __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, 0,
- __LONG_LONG_PAIR (zero, off_low),
- __LONG_LONG_PAIR (zero, len_low)));
-# elif __WORDSIZE == 64
- INTERNAL_SYSCALL_DECL(err);
- ret = (int) (INTERNAL_SYSCALL(fallocate, err, 4, fd, 0, 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)))
- return INTERNAL_SYSCALL_ERRNO (ret, err);
- return 0;
+ return __libc_fallocate(fd, 0, offset, len);
}
# if defined __UCLIBC_HAS_LFS__ && __WORDSIZE == 64
strong_alias(posix_fallocate,posix_fallocate64)