This is the mail archive of the
mailing list for the Cygwin project.
Re: odd socketpair() failure
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 4 Aug 2011 10:25:45 +0200
- Subject: Re: odd socketpair() failure
- References: <4E39D525.firstname.lastname@example.org>
- Reply-to: cygwin at cygwin dot com
On Aug 3 17:09, Eric Blake wrote:
> A while ago, I tested pipe() for EMFILE failures . Well, I
> repeated those tests for socketpair() , 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.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple