1 .\" Copyright (c) 1980, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)open.2 8.2 (Berkeley) 11/16/93
35 .Nd pre-allocate storage for a range in a file
41 .Fn posix_fallocate "int fd" "off_t offset" "off_t len"
43 Required storage for the range
48 in the file referenced by
50 is guaranteed to be allocated upon successful return.
53 returns successfully, subsequent writes to the specified file data
54 will not fail due to lack of free space on the file system storage
56 Any existing file data in the specified range is unmodified.
60 is beyond the current file size, then
62 will adjust the file size to
65 Otherwise, the file size will not be changed.
69 will be freed by a successful call to
73 that truncates the size of the file.
76 may be freed by a successful call to
78 that reduces the file size to a size smaller than
85 It returns an error on failure, without setting
88 Possible failure conditions:
93 argument is not a valid file descriptor.
97 argument references a file that was opened without write permission.
102 is greater than the maximum file size.
104 A signal was caught during execution.
108 argument was less than or equal to zero, the
110 argument was less than zero,
111 or the operation is not supported by the file system.
113 An I/O error occurred while reading from or writing to a file system.
115 Corrupted data was detected while reading from the file system.
119 argument does not refer to a file that supports
122 There is insufficient free space remaining on the file system storage
124 .It Bq Er ENOTCAPABLE
127 has insufficient rights.
131 argument is associated with a pipe or FIFO.
141 system call conforms to
150 and this manual page were initially written by
151 .An Matthew Fleming Aq Mt mdf@FreeBSD.org .