[PATCH 0/1] Update _PC_ASYNC_IO return value

Mark Geisert mark@maxrnd.com
Thu Jul 26 08:52:00 GMT 2018


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.

Is there a reference I could check for the meaning of the flag?  I'll do 
an online search in the meantime.
Thanks again,

..mark



More information about the Cygwin-patches mailing list