Implementing aio_* and lio_* (async i/o) on Cygwin

Corinna Vinschen
Tue Mar 20 10:11:00 GMT 2018

On Mar 19 22:53, Mark Geisert wrote:
> Corinna Vinschen wrote (a while back):
> > However, using async IO, the only change necessary would be to change
> > prw_open to open an async handle, and pread/pwrite to wait for the
> > result if the current I/O is NOT async.  It may be necessary to add a
> > parameter or two to the pread/pwrite fhandler methods, but all the rest
> > of the functionality could be in the callers.
> I see what you're suggesting; seems sly in a nice way :).
> A small part I'm missing is in interfacing to the layer above this.  Are the
> aio_* functions supposed to be implemented as "real" syscalls (in
> Or should they be implemented in their own (which is
> where I have them ATM) and call pread()/pwrite() to do their dirty work?
> I'm unsure how "central" a syscall has to be to merit location. is historical.  Cygwin has grown over a single file to keep
"syscalls" anyway, so having the interfaces in an file doesn't

> Regardless of which file the code is in, I was thinking I should copy
>'s pread() contents into aio_read(), for example, to start with.
> Then add extra param(s) as needed to the fhandler method call as you
> suggested.

That's definitely ok.  When I was talking about pread/pwrite in our
preliminary discussion on cygwin-patches, I was always talking about the
fhandler_disk_file::pread and fhandler_disk_file::pwrite methods in
fact, not the syscalls of the same name.  I'm sorry I was unclear there :}

> The problem with having aio_read() call pread() directly is how to tell
> pread() we want an async read.  That's why I was suggesting O_ASYNC
> previously, though I now understand that's the wrong direction to go.  What
> is the correct direction?

Looks like you're on the right track, just go ahead.  We can fix the
finer details later.


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: <>

More information about the Cygwin-developers mailing list