[PATCH] D39464: Define fs::allocate_file which preallocates disk blocks.
Kamil Rytarowski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 13 01:48:48 PST 2017
krytarowski added inline comments.
================
Comment at: llvm/lib/Support/Unix/Path.inc:436
return std::error_code(Err, std::generic_category());
+ return make_error_code(errc::function_not_supported);
}
----------------
ruiu wrote:
> krytarowski wrote:
> > NetBSD needs `ftruncate`(2) as a fallback for `posix_fallocate`(2).
> >
> > In the default setup `posix_fallocate`() returns EOPNOTSUPP.
> The current code use ftruncate if the function is available. So it doesn't use it as a fallback, but it uses only fallocate. It seems like a OK behavior to me on NetBSD if posix_fallocate always returns EOPNOTSUPP, but can you confirm?
By "the current code" I understand the pristine one. It calls posix_fallocate(2) and if it fails with EOPNOTSUPP, it moves on to the ftruncate(2) fallback.
As far as I can tell, this fallocate is a missing feature as of today in the FFSv2 file-system, the default one on NetBSD.
https://reviews.llvm.org/D39464
More information about the llvm-commits
mailing list