From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10347 invoked by alias); 4 Aug 2011 08:26:26 -0000 Received: (qmail 10171 invoked by uid 22791); 4 Aug 2011 08:26:04 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Thu, 04 Aug 2011 08:25:48 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id CA1A62C03BB; Thu, 4 Aug 2011 10:25:45 +0200 (CEST) Date: Thu, 04 Aug 2011 08:26:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: odd socketpair() failure Message-ID: <20110804082545.GA12783@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <4E39D525.5070804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4E39D525.5070804@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-08/txt/msg00115.txt.bz2 On Aug 3 17:09, Eric Blake wrote: > A while ago, I tested pipe() for EMFILE failures [1]. Well, I > repeated those tests for socketpair() [2], and cygwin is once again > the odd man out. > [...] > after fd 3199, open failed with errno 24 Too many open files > try 1, socketpair returned -1 errno 24 Too many open files, fds -2 -3 > try 2, socketpair returned -1 errno 24 Too many open files, fds -2 -3 > try 3, socketpair returned -1 errno 24 Too many open files, fds -2 -3 > > But on Linux, try 3 succeeds. Something in cygwin is not quite > right on try 3 - the program explicitly freed two fd slots (0 and > 3199), so it should have plenty of room to create the socketpair > without hitting EMFILE. The socketpair function forgot to free the descriptor slot of the first socket if there was no room left for the second socket. Fixed in CVS. Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple