[PATCH] libc: add fallback for posix_fallocate() when not supported by underlying FS

Rich Felker dalias at libc.org
Mon Sep 29 16:42:41 UTC 2014


On Mon, Sep 29, 2014 at 04:43:32PM +0200, Olivier Blin wrote:
> EOPNOTSUPP is not a valid error code for posix_fallocate(), the
> implementation should have a fallback when the underlying filesystem
> does not support fallocate().
> 
> This is especially useful when using posix_fallocate() on tmpfs with
> kernels older than 3.5, for which there was no fallocate support.
> 
> This copies the implementation of the internal fallback from glibc,
> with a few adaptations for internals symbols.

This code is dangerous (has race conditions that cause file
corruption) and should not be added. See the bug report for the
corresponding code in glibc:

https://sourceware.org/bugzilla/show_bug.cgi?id=15661

Rich


More information about the uClibc mailing list