[PATCH 4/4] posix: Implement preadv2 and pwritev2
Zack Weinberg
zackw@panix.com
Fri Apr 28 14:14:00 GMT 2017
On Thu, Apr 27, 2017 at 5:30 PM, Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> On default 'posix' implementation trying to emulate the Linux supported
> flags is troublesome:
>
> * We can not temporary change the file state of the O_DSYNC and O_SYNC
> flags to emulate RWF_{D}SYNC (attempts to change the state of using
> fcntl are silently ignored).
>
> * IOCB_HIPRI requires the file opened in O_DIRECT and uses an internal
> semantic not provided by any other flag (O_NONBLOCK for instance).
>
> So default implementation just ignore the flag argument and calls generic
> preadv/pwritev.
Wouldn't it be better for the default implementation to fail if the
flags argument is nonzero? Especially for sync operations - if it
fails, applications can fall back to fsync or whatever, but if it
succeeds without actually performing a sync, that's asking for data
loss.
zw
More information about the Libc-alpha
mailing list