<div dir="ltr">I'd use fallocate(2) instead of posix_fallocate. fallocate does, contrary to posix's one, return an error if an underlying filesystem doesn't support the feature. You can just ignore the error.<div><br></div><div>Since fallocate is Linux-specific, you would have to add HAS_FALLOCATE.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 19, 2016 at 1:52 PM, Rafael EspĂ­ndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 19 July 2016 at 14:31, Rafael EspĂ­ndola <<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>> wrote:<br>
> On 19 July 2016 at 13:11, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
>> I have a concern about this change when it is used on a filesystem that<br>
>> doesn't support file pre-allocation. The function should work on a<br>
>> filesystem that doesn't support an underlying fallocate(-ish) system call,<br>
>> but in that case I believe it tries to actually write data to force<br>
>> allocation. In that case it'd be slow.<br>
><br>
> It still seems better than crashing, no?<br>
><br>
> Which filesystems do you have in mind? I have a spare partition, so I<br>
> should be able to test pretty much anything that linux supports. I<br>
> will give HFS+ a try on OS X too.<br>
<br>
<br>
</span>OS X is missing posix_fallocate :-(<br>
<br>
I am looking for an alternative.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>