[RFC] 4950302: (fs spec) Random write produces different results on Linux vs Windows from same .class

David Lloyd david.lloyd at redhat.com
Thu Nov 21 22:00:42 UTC 2019


On Thu, Nov 21, 2019 at 4:00 PM David Lloyd <david.lloyd at redhat.com> wrote:
>
> On Thu, Nov 21, 2019 at 12:39 PM Brian Burkhalter
> <brian.burkhalter at oracle.com> wrote:
> >
> >
> > On Nov 19, 2019, at 4:52 PM, David Lloyd <david.lloyd at redhat.com> wrote:
> >
> > What if, on Linux (newer kernels only unfortunately), instead of using
> > O_APPEND at open, instead use pwritev2() and pass RWF_APPEND when
> > writing if the channel was opened for append?  This would eliminate
> > the extra system calls.  If you pass a -1 as the offset to that call
> > with that flag set, then the file's offset is updated.
> >
> >
> > With respect to pwritev2(), the RWF_APPEND flag curiously does not appear in Ubuntu 18.04.3 LTS despite this being on a Linux 5 kernel:
> >
> > $ uname -s -r -v
> > Linux 5.0.0-36-generic #39~18.04.1-Ubuntu SMP Tue Nov 12 11:09:50 UTC 2019
> >
> > According to [1] RWF_APPEND is supposed to be since Linux 4.16. Am I missing something?
> >
> > Thanks,
> >
> > Brian
> >
> > [1] https://manpages.debian.org/testing/manpages-dev/preadv2.2.en.html
>
> It probably has more to do with the glibc (and associated header
> files) in use.  You consider directly defining the symbols if a
> feature test macro check doesn't satisfy?

You *might* consider...


-- 
- DML



More information about the nio-dev mailing list