public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: odd socketpair() failure
Date: Thu, 04 Aug 2011 08:26:00 -0000	[thread overview]
Message-ID: <20110804082545.GA12783@calimero.vinschen.de> (raw)
In-Reply-To: <4E39D525.5070804@redhat.com>

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

      parent reply	other threads:[~2011-08-04  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 23:09 Eric Blake
2011-08-04  6:00 ` Marco atzeri
2011-08-04  8:26 ` Corinna Vinschen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110804082545.GA12783@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).