posix_fallocate(3) Library Functions Manual posix_fallocate(3) posix_fallocate - LIBRARY Standard C library (libc, -lc) #include int posix_fallocate(int fd, off_t offset, off_t len); glibc (. feature_test_macros(7)): posix_fallocate(): _POSIX_C_SOURCE >= 200112L posix_fallocate() , , , fd, offset len . posix_fallocate() - . offset+len, ; . posix_fallocate() 0, . , errno . EBADF fd . EFBIG offset+len . EINTR . EINVAL offset , len 0, , , . ENODEV fd . ENOSPC , , fd. EOPNOTSUPP The filesystem containing the file referred to by fd does not support this operation. This error code can be returned by C libraries that don't perform the emulation shown in NOTES, such as musl libc. ESPIPE fd . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |posix_fallocate() | | MT-Safe ( | | | | | | | | ) | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. glibc 2.1.94. POSIX.1-2001 POSIX.1-2008 , EINVAL, len 0 offset 0. POSIX.1-2001 , EINVAL, len 0 offset 0, , len 0. CAVEATS glibc posix_fallocate() fallocate(2), . fallocate(2), : o . o , null . o , , . o fd O_APPEND O_WRONLY, EBADF. , . Linux fallocate(2), . , , , EOPNOTSUPP, , glibc. . fallocate(1), fallocate(2), lseek(2), posix_fadvise(2) Alexey, Azamat Hackimov , kogamatranslator49 , Kogan, Max Is , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . posix_fallocate(3)