cygwin 3.3.x: another problem that may be related to pipes

Ken Brown kbrown@cornell.edu
Mon Nov 15 15:36:19 GMT 2021


On 11/15/2021 10:27 AM, Ken Brown wrote:
> On 11/15/2021 10:11 AM, Takashi Yano wrote:
>> I might be wrong. Your code certainly waits for something happening.
>> I am not sure why it works...
> 
> FWIW, I got the idea for this from the following code in 
> fhandler_socket_unix::listen_pipe:
> 
>    io.Status = STATUS_PENDING;
>    if (!is_nonblocking () && !(evt = create_event ()))
>      return -1;
>    status = NtFsControlFile (get_handle (), evt, NULL, NULL, &io,
>                  FSCTL_PIPE_LISTEN, NULL, 0, NULL, 0);
>    if (status == STATUS_PENDING)
>      {
>        waitret = cygwait (evt ?: get_handle (), cw_infinite,
>               cw_cancel | cw_sig_eintr);
>        if (waitret == WAIT_OBJECT_0)
>      status = io.Status;
>      }

And here's Corinna's answer when I asked her to explain it:

   https://cygwin.com/pipermail/cygwin-developers/2021-April/012093.html

Ken


More information about the Cygwin-developers mailing list