delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2000/06/11/05:05:23

Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm
list-help: <mailto:cygwin-apps-help AT sourceware DOT cygnus DOT com>
list-post: <mailto:cygwin-apps AT sourceware DOT cygnus DOT com>
Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-apps AT sourceware DOT cygnus DOT com
Sender: corinna AT cvhp DOT vinschen DOT de
Message-ID: <394355CA.E1447AEA@vinschen.de>
Date: Sun, 11 Jun 2000 11:03:06 +0200
From: Corinna Vinschen <corinna AT vinschen DOT de>
Reply-To: cygapp <cygwin-apps AT sourceware DOT cygnus DOT com>
Organization: Cygnus Solutions, a Red Hat company
X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.14 i686)
X-Accept-Language: de, en
MIME-Version: 1.0
To: Robert Collins <robert DOT collins AT itdomain DOT com DOT au>
CC: cygwin-apps AT sourceware DOT cygnus DOT com
Subject: Re: fnctl nonblocking still blocking
References: <006301bfd338$a964d450$f7c723cb AT lifelesswks>

First of all, please don't post HTML mail to the mailing list.
Use plain text mail instead. Thanks.

> Robert Collins wrote:
> Hi,
>     I am working on porting Squid to cygwin, I posted before about a
> problem with accept() stopping on the second call to it.
> 
> I have tracked it down to the socket still blocking on io when there
> is no pending connection, even though the earlier call to fnctl was
> successful.
> 
> The call made is (fcntl(fd, F_SETFL, flags | SQUID_NONBLOCK) < 0),
> where flags was retrieved by a prior call to F_GETFL, and
> SQUID_NONBLOCK is #defined to be O_NONBLOCK, I have also tried
> O_NDELAY with the same results.
> 
> My question(s) are:
> what is the official status of non-blocking accept() calls in cygwin
> 1.1.2?
> where in the winsup source is fcntl implemented? I found a call to
> _fcntl but could find where that has been implemented to follow
> through...

Unfortunately, the current fcntl implementation is useless
for what you want to do. It still needs some effort to extend
fcntl's functionality. You have two different chances for a
short term solution, AFAICS:

- Either you change Squid to call `accept' only if a previous
  call to `select' succeeds in finding a connection request
- or you change the affected fcntl call to

#ifdef __CYGWIN__
	int nonblocking = TRUE;
	ioctl(socket, FIONBIO, &nonblocking);
#else
	fcntl(socket,...
#endif

Hope, that helps,
Corinna

-- 
Corinna Vinschen
Cygwin Developer
Cygnus Solutions, a Red Hat company

- Raw text -


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