<div dir="ltr">Does FreeBSD have fallocate(2) or equivalent?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 30, 2017 at 4:32 PM, Ed Maste <span dir="ltr"><<a href="mailto:emaste@freebsd.org" target="_blank">emaste@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 23 October 2017 at 18:49, Rui Ueyama via llvm-dev<br>
<span class=""><<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> BTW, posix_fallocate() might provide better portability and decrease the<br>
>> likelihood of falling back on ftruncate().<br>
><br>
> Yes, but we want to avoid that function because when it falls back, it is<br>
> very slow. What it does when fallocate(2) is not available is to actually<br>
> write 0 to every block to make sure that all disk blocks are allocated.<br>
<br>
</span>Note that posix_fallocate may return EINVAL if the underlying<br>
filesystem does not support the operation.<br>
</blockquote></div><br></div>