<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 19, 2016 at 2:29 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 15:11, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
> I'd use fallocate(2) instead of posix_fallocate. fallocate does, contrary to<br>
> posix's one, return an error if an underlying filesystem doesn't support the<br>
> feature. You can just ignore the error.<br>
<br>
</span>But why is that an advantage? It the underlying FS don't support<br>
ftruncate we would have to implement an emulation similar to what<br>
posix_fallocate does or risk a sigbus. We would also need more ifdefs<br>
for freebsd for example.</blockquote><div><br></div><div>Well, is detecting a disk full event so important to risk that it could slow down the linker on NFS or such? It'd depend how often you hit it, but to me it doesn't feel like a good trade-off.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> Since fallocate is Linux-specific, you would have to add HAS_FALLOCATE.<br>
<br>
</span>Well, since it is linux only we could use "#if defined(__linux__)"<br>
which is already used in Path.inc.<br>
<br>
In any case, a patch that also works on OS X is attached.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div></div>