X-Spam-Check-By: sourceware.org Date: Mon, 9 Oct 2006 14:39:35 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: How to select on a win32 handle? Message-ID: <20061009123935.GG13105@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20061007025233 DOT GA24180 AT sellafield DOT lysator DOT liu DOT se> <20061009085518 DOT GD13105 AT calimero DOT vinschen DOT de> <20061009100420 DOT GC23365 AT arnhem DOT lysator DOT liu DOT se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061009100420.GC23365@arnhem.lysator.liu.se> User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Oct 9 12:04, Peter Ekberg wrote: > On Mon, Oct 09, 2006 at 10:55:18AM +0200, Corinna Vinschen wrote: > > 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. Take a look into winsup/cygwin/select.cc. There's no generic way to select on an arbitrary Windows handle without knowledge about its task. Selecting manually, for instance by creating a thread which calls WFMO, is the only useful choice, IMHO. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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/