delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/16/23:48:41

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Sent: 17 Apr 2003 03:48:32 GMT
Message-ID: <008301c30494$3ac5ac50$0200a8c0@abackusdell2>
From: "Abraham Backus" <abraham AT backus DOT com>
To: <cygwin AT cygwin DOT com>
References: <Pine DOT GSO DOT 4 DOT 44 DOT 0304141917120 DOT 26381-100000 AT slinky DOT cs DOT nyu DOT edu>
Subject: Re: ENOTSOCK errors with cygwin dll 1.3.21 and 1.3.22
Date: Wed, 16 Apr 2003 20:48:37 -0700
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

------=_NextPart_000_0080_01C30459.8E077640
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Thanks Igor.  I've downloaded the cygwin cvs and am trying to track down
what's up in any spare time that I get.  In the meantime though, I've copied
some code from a testcase for one of the patches and made some of my own
modifications to run it using inetd.  With 1.3.20, the code is ok.  With
1.3.22 however, the calls to fgets(), fputs(), and fflush() all fail with
"Socket operation on non-socket" (errno=ENOTSOCK)


----- Original Message -----

> Look in winsup/cygwin/ChangeLog between "Bump DLL minor number to 22" and
> "Bump DLL minor number to 23"...  You could also look in the cygwin-cvs
> list archives between 3/9 and 3/13.
>
> FWIW, I see the following socket-related changes:
> <http://cygwin.com/ml/cygwin-cvs/2003-q1/msg00359.html>
> <http://cygwin.com/ml/cygwin-cvs/2003-q1/msg00352.html>
> <http://cygwin.com/ml/cygwin-cvs/2003-q1/msg00350.html>
> but I might have missed something...

------=_NextPart_000_0080_01C30459.8E077640
Content-Type: text/plain;
	name="main.cc"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="main.cc"

#include <syslog.h>=0A=
#include <errno.h>=0A=
#include <sys/stat.h>=0A=
#include <sys/types.h>=0A=
#include <stdio.h>=0A=
#include <string.h>=0A=
=0A=
void checkIsSocket(int fd)=0A=
{=0A=
	struct stat buf;=0A=
	memset(&buf, 0, sizeof (buf));=0A=
	if (fstat(fd, &buf) < 0)=0A=
	{=0A=
		syslog(LOG_INFO, "fstat() failed with %d\n", errno);=0A=
		return;=0A=
	}=0A=
=0A=
	if (S_ISSOCK(buf.st_mode))=0A=
	{=0A=
		syslog(LOG_INFO, "fd %d is a socket\n", fd);=0A=
	}=0A=
	else=0A=
	{=0A=
		syslog(LOG_INFO, "fd %d is not a socket\n", fd);=0A=
	}=0A=
}=0A=
=0A=
int main()=0A=
{=0A=
	checkIsSocket(0);=0A=
	checkIsSocket(1);=0A=
	checkIsSocket(2);=0A=
=0A=
	char buf[1024];=0A=
	if (NULL =3D=3D fgets(buf, 1024, stdin))=0A=
	{=0A=
		syslog(LOG_INFO, "stdin %s", strerror(errno));=0A=
	}=0A=
	if (EOF =3D=3D fputs("yo", stdout))=0A=
	{=0A=
		syslog(LOG_INFO, "stdout %s", strerror(errno));=0A=
	}=0A=
	else=0A=
	{=0A=
		if (EOF =3D=3D fflush(stdout))=0A=
		{=0A=
			syslog(LOG_INFO, "stdout flush %s", strerror(errno));=0A=
		}=0A=
	}=0A=
	if (EOF =3D=3D fputs("yo", stderr))=0A=
	{=0A=
		syslog(LOG_INFO, "stderr %s", strerror(errno));=0A=
	}=0A=
	else=0A=
	{=0A=
		if (EOF =3D=3D fflush(stderr))=0A=
		{=0A=
			syslog(LOG_INFO, "stderr flush %s", strerror(errno));=0A=
		}=0A=
	}=0A=
}=0A=


------=_NextPart_000_0080_01C30459.8E077640
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
------=_NextPart_000_0080_01C30459.8E077640--


- Raw text -


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