[PATCH 0/1] Update _PC_ASYNC_IO return value

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Jul 26 10:17:00 GMT 2018


On Jul 26 01:51, Mark Geisert wrote:
> Hi Corinna,
> 
> On Thu, 26 Jul 2018, Corinna Vinschen wrote:
> > On Jul 25 15:06, Yaakov Selkowitz wrote:
> > > > From discussion on IRC:
> > > 
> > > <yselkowitz> corinna, just sent a patch for _POSIX_ASYNCHRONOUS_IO as a
> > > 	  follow-up to the AIO feature, but am still wondering about
> > > 	  _[POSIX|PC]_ASYNC_IO
> > > [snip]
> > > <corinna> in terms of _PC_ASYNC_IO, the test might be a bit tricky
> > > <corinna> let me check
> > > <corinna> actually, no
> > > <corinna> it's easy
> > > <corinna> Mark implemented the stuff with pread/pwrite only on disk files
> > > <corinna> but otherwise it's device independent in that he implemented a
> > > 	  workaround for pipes and stuff
> > > <corinna> so, in theory we can just return 1
> > > 
> > > I'm not sure how to test this atm, but based on the above I have made
> > > the following patch so this doesn't get lost.
> > > 
> > > Yaakov Selkowitz (1):
> > >   Cygwin: fpathconf: update _PC_ASYNC_IO return value
> > > 
> > >  winsup/cygwin/fhandler.cc | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > --
> > > 2.17.1
> > 
> > Mark?  Any comment you want to make?
> 
> Thanks for asking.  Your characterization of my implementation is correct.
> The intent is for aio_* async I/O to be supported on all descriptors.  On
> the most useful case of binary local disk files, inline pread|pwrite is
> used.  But I wanted to make sure the AIO interface would do the right thing
> on other kinds of descriptors without bothering the user about it.
> 
> So if the intent of the _PC_ASYNC_IO flag is to say that async I/O is
> supported generally, I do think setting it to 1 is appropriate.  That is,
> if it's talking about the aio_* interfaces.  If there's an O_ASYNC defined
> for app coders, my recent contribution doesn't address that at all.

Good question.  O_ASYNC is a BSD invention, and it's not defined in
POSIX at all.  Since we're in POSIX territory, _PC_ASYNC_IO and
_POSIX_ASYNC_IO can only refer to async io as implemented by your new
aio code:

- _POSIX_ASYNCHRONOUS_IO defines if the implementation supports async io
  at all.
- _POSIX_ASYNC_IO defines if the file in question supports async io.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20180726/2b512448/attachment.sig>


More information about the Cygwin-patches mailing list