1 /* 2 * posix_fallocate() for uClibc 3 * http://www.opengroup.org/onlinepubs/9699919799/functions/posix_fallocate.html 4 * 5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> 6 * 7 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. 8 */ 9 10 #include <sys/syscall.h> 11 #include <fcntl.h> 12 #include <bits/kernel-features.h> 13 #include <stdint.h> 14 #include <errno.h> 15 16 #if defined __NR_fallocate 17 extern __typeof(fallocate) __libc_fallocate attribute_hidden; posix_fallocate(int fd,__off_t offset,__off_t len)18int posix_fallocate(int fd, __off_t offset, __off_t len) 19 { 20 if (__libc_fallocate(fd, 0, offset, len)) 21 return errno; 22 return 0; 23 } 24 # if __WORDSIZE == 64 25 strong_alias(posix_fallocate,posix_fallocate64) 26 # endif 27 #endif 28