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 2010-09-20 "GNU" "Linux Programmer's Manual"
25 posix_fallocate \- allocate file space
30 .BI "int posix_fallocate(int " fd ", off_t " offset ", off_t " len );
35 Feature Test Macro Requirements for glibc (see
36 .BR feature_test_macros (7)):
39 .BR posix_fallocate ():
41 _XOPEN_SOURCE\ >=\ 600 || _POSIX_C_SOURCE\ >=\ 200112L
46 .BR posix_fallocate ()
47 ensures that disk space is allocated for the file referred to by the
50 for the bytes in the range starting at
55 After a successful call to
56 .BR posix_fallocate (),
57 subsequent writes to bytes in the specified range are
58 guaranteed not to fail because of lack of disk space.
60 If the size of the file is less than
62 then the file is increased to this size;
63 otherwise the file size is left unchanged.
65 .BR posix_fallocate ()
66 returns zero on success, or an error number on failure.
74 is not a valid file descriptor, or is not opened for writing.
78 exceeds the maximum file size.
84 was less than or equal to 0.
88 does not refer to a regular file.
91 There is not enough space left on the device containing the file
97 refers to a pipe of file descriptor.
99 .BR posix_fallocate ()
100 is available since glibc 2.1.94.
104 POSIX.1-2008 says that an implementation
113 POSIX.1-2001 says that an implementation
129 .BR posix_fadvise (2)