summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/posix_fallocate.c
AgeCommit message (Collapse)Author
2015-10-05libc: posix_fallocate must return an error number on failureYuriy Kolerov
posix_fallocate implementation in uClibc relies on fallocate system call - it just returns what fallocate returns. However fallocate returns -1 on failure and assigns an error number to errno variable. In the same time posix_fallocate must return an error number but not -1. What does this patch: if fallocate returns -1 then posix_fallocate returns errno. Otherwise posix_fallocate returns 0 on success. However there is a side effect - posix_fallocate sets errno on failure because fallocate does it. But POSIX does not forbid it thus it's not a problem. Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
2014-09-09libc: add fallocate() and fallocate64()Anthony G. Basile
We add the Linux-specific function fallocate() which allows the user to directly manipulate allocate space for a file. fallocate() can operate in different modes, but the default mode is equivalent to posix_fallocate() which is specified in POSIX.1. Recent releases of e2fsprogs 1.42.11 and above expect fallocate64() to be available. Signed-off-by: Anthony G. Basile <blueness@gentoo.org> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-11libc: add posix_fallocate()Bernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>