1 .\" Copyright (c) 2006, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .TH POSIX_FALLOCATE 3 2006-03-01 "GNU" "Linux Programmer's Manual"
25 posix_fallocate \- allocate file space
28 .B #define _XOPEN_SOURCE 600
31 .BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len );
35 .BR posix_fallocate ()
36 ensures that disk space is allocated for the file referred to by the
39 for the bytes in the range starting at
44 After a successful call to
45 .BR posix_fallocate (),
46 subsequent writes to bytes in the specified range are
47 guaranteed not to fail because of lack of disk space.
49 If the size of the file is less than
51 then the file is increased to this size;
52 otherwise the file size is left unchanged.
54 .BR posix_fallocate ()
55 returns zero on success, or an error number on failure.
63 is not a valid file descriptor, or is not opened for writing.
67 exceeds the maximum file size.
77 does not refer to a regular file.
80 There is not enough space left on the device containing the file
86 refers to a pipe of file descriptor.
88 .BR posix_fallocate ()
89 is available since glibc 2.1.94.
95 .BR posix_fadvise (2),
96 .BR feature_test_macros (7)