delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/09/06:04:39

X-Spam-Check-By: sourceware.org
Date: Mon, 9 Oct 2006 12:04:20 +0200
From: Peter Ekberg <peda AT lysator DOT liu DOT se>
To: cygwin AT cygwin DOT com
Subject: Re: How to select on a win32 handle?
Message-ID: <20061009100420.GC23365@arnhem.lysator.liu.se>
References: <20061007025233 DOT GA24180 AT sellafield DOT lysator DOT liu DOT se> <20061009085518 DOT GD13105 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20061009085518.GD13105@calimero.vinschen.de>
User-Agent: Mutt/1.4.1i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mon, Oct 09, 2006 at 10:55:18AM +0200, Corinna Vinschen wrote:
> On Oct  7 04:52, Peter Ekberg wrote:
> > Hello!
> > 
> > I'm finding that I have a need to select on a win32 handle. I found the
> > function cygwin_attach_handle_to_fd which sounded promising, but I do
> > not have any luck when I try to use it.
> 
> That won't work.  The Windows select function is only implemented for
> sockets.

Yes, it is pretty damn broken.

>           To implement a POSIX select function which allows to select on
> any descriptor one needs to implement it specificially for each known,
> resp. useful file type.  Naturally this won't work with a generic
> Windows handle since Cygein doesn't know what it represents.  So Cygwin
> is unable to provide a matching select function.

I assumed that cygwin as a last step issued a WaitFor... on the underlying
win32 handles associated with the fds in its select implementation. Perhaps
this assumption was wrong? But if not, it would be neat to somehow add an
extra win32 handle to the array, that would break out of the cygwin select
when the win32 handle is signaled.

But I understand that this is pretty far from "Linux compatibility" so I'm
not expecting any sympathy for my twisted needs. :-)

Cheers,
Peter

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019