Section: Linux Programmer's Manual (3)
Return to Main Contents
posix_fallocate - allocate file space
#define _XOPEN_SOURCE 600
int posix_fallocate(int fd, off_t offset, off_t len);
ensures that disk space is allocated for the file referred to by the
for the bytes in the range starting at
and continuing for
After a successful call to
subsequent writes to bytes in the specified range are
guaranteed not to fail because of lack of disk space.
If the size of the file is less than
then the file is increased to this size;
otherwise the file size is left unchanged.
returns zero on success, or an error number on failure.
is not set.
is not a valid file descriptor, or is not opened for writing.
exceeds the maximum file size.
was less than 0.
does not refer to a regular file.
There is not enough space left on the device containing the file
referred to by
refers to a pipe of file descriptor.
is available since glibc 2.1.94.
- RETURN VALUE
- CONFORMING TO
- SEE ALSO
linux.jgfs.net manual pages