On Tue, Sep 30, 2014 at 05:21:43PM -0400, Anthony G. Basile wrote:
> On 09/29/14 13:39, Olivier Blin wrote:
> >On 09/29/14 18:42, Rich Felker wrote:
> >>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
> >Indeed, this is dangerous.
> >
> >According to the specification of posix_fallocate(), there does not seem
> >to be an appropriate error code to return when the filesystem driver
> >does not natively support fallocate().
> >In this case, the libc should probably provide a fallback implementation.
> 
> Why can't there be an implementation specific error message here
> since the specs are silent on the issue?  I see no problem with
> returning ENOTSUP even though its not specified in [1].

For details see XSH 2.3 Error Numbers:

"Implementations may support additional errors not included in this
list, may generate errors included in this list under circumstances
other than those described here, or may contain extensions or
limitations that prevent some errors from occurring.

...

Implementations may generate error numbers listed here under
circumstances other than those described, if and only if all those
error conditions can always be treated identically to the error
conditions as described in this volume of POSIX.1-2008.
Implementations shall not generate a different error number from one
required by this volume of POSIX.1-2008 for an error condition
described in this volume of POSIX.1-2008, but may generate additional
errors unless explicitly disallowed for a particular function."

Source:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_03

Rich
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to