posix_fallocate
A POSIX library function that reserves storage for a file byte range and reports failure by returning an error number directly.
It returns zero on success; do not test for -1 or use errno as its result. glibc 2.40 tries native allocation first and uses emulation after EOPNOTSUPP. Its read/write fallback can race concurrent modifications; this is not a universal property of native allocation or every C library.
Relations
- related
- file-preallocation, sparse-file, unwritten-extent