This is the mail archive of the
mailing list for the Cygwin project.
Re: ENOTSOCK errors with cygwin dll 1.3.21 and 1.3.22
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 24 May 2003 11:15:56 +0200
- Subject: Re: ENOTSOCK errors with cygwin dll 1.3.21 and 1.3.22
- References: <Pine.GSO.firstname.lastname@example.org> <008301c30494$3ac5ac50$0200a8c0@abackusdell2> <20030421202002.GD11137@cygbert.vinschen.de> <002301c32163$cac78c60$0200a8c0@abackusdell2>
- Reply-to: cygwin at cygwin dot com
On Fri, May 23, 2003 at 12:44:57PM -0700, Abraham Backus wrote:
> * fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid
> using WinSock2 socket duplication methods. Add comment.
> This is what's causing me grief.
> I built the 1.3.22 sources, commenting out the line:
> if (! wincap.has_security ())
> and my inetd apps work ok again.
> I've been searching the web and archives to try and find out what's the
> difference between WSADuplicateSocket and DuplicateHandle and I can't really
> seem to find anything, other than an MS KB 150523 "BUG: Socket Inheritance
> on Different Windows Platforms". I don't mind investigating further, but I
> think I've come to a roadblock.... In the comment with the patch, it says
> "Using WinSock2 methods for dup'ing sockets seem to collide with user
> context switches under... some... conditions." Where can I find more
> information on this user context collision problem?
There's discussion on the cygwin-developers list. Basically what
happened (before the above change was applied) was this:
Start the following under SYSTEM account:
fd = socket ();
fd2 = dup (fd);
close (fd2); <-- returns WSAENOTSOCK
For some reason this does not happen if the process is started from a
native windows process (e.g. cmd.exe) but it happens when the process
is started from another Cygwin process. We still don't know why that
happens (therefore the "...some..." comment) but using simple socket
handle duplication instead of WinSock2 WSASocket/WSADuplicateSocket
when duplication a socket resolved that problem.
> I have WinXP Home SP1.
Me, too. And note that it works for me!
There was only one socket problem reported for Windows XP so far,
KB article 319952 but it doesn't seem to be related. Sic.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Developer mailto:email@example.com
Red Hat, Inc.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html