This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: PostgreSQL and CVS DLL


Corinna Vinschen writes:
>
>On Wed, Jan 09, 2002 at 03:00:52PM -0500, Norman Vine wrote:
>> (gdb) bt full
>> #0  strncpy (dst0=0xa01d712 "", src0=0x0, count=109)
>>     at /src/cygwin/src/newlib/libc/string/strncpy.c:116
>>         dst0 = 0xa01d712 ""
>>         count = 109
>>         dst = 0xa01d712 ""
>>         src = 0x0
>>         aligned_dst = (long int *) 0xa01d712
>>         aligned_src = (long int *) 0x22f924
>> #1  0x61033758 in cygwin_getsockname (fd=7, addr=0xa01d710,
>> namelen=0x22f924)
>
>Is postgreSQL using socketpairs, perhaps?

Corinna

Today is the first time that I have looked at the postgreSQL source
and I know very little about socket programing but if you are asking 
does postgreSQL have a both a 'local' and a 'tcp' socket stream
it appears so.

HTH

Norman

!! HAVE_UNIX_SOCKETS == TRUE below

>#2  0x004bf0a6 in StreamConnection (server_fd=3, port=0xa01d5d0)
    at pqcomm.c:401

StreamConnection(int server_fd, Port *port)
...

#401	addrlen = sizeof(port->laddr);
	if (getsockname(port->sock, (struct sockaddr *) & port->laddr,
					&addrlen) < 0)
	{
		perror("postmaster: StreamConnection: getsockname");
		return STATUS_ERROR;
	}

	/* select NODELAY and KEEPALIVE options if it's a TCP connection */
	if (port->laddr.sa.sa_family == AF_INET)
	{
		int			on = 1;

		if (setsockopt(port->sock, IPPROTO_TCP, TCP_NODELAY,
					   (char *) &on, sizeof(on)) < 0)
		{
			perror("postmaster: StreamConnection: setsockopt(TCP_NODELAY)");
			return STATUS_ERROR;
		}
		if (setsockopt(port->sock, SOL_SOCKET, SO_KEEPALIVE,
					   (char *) &on, sizeof(on)) < 0)
		{
			perror("postmaster: StreamConnection: setsockopt(SO_KEEPALIVE)");
			return STATUS_ERROR;
		}
	}

#3  0x004f5a52 in ConnCreate (serverFd=3) at postmaster.c:1298
        port = (Port *) 0xa01d5d0
#4  0x004f4cda in ServerLoop () at postmaster.c:905
        port = (Port *) 0x0
        rmask = {fds_bits = {8, 0}}
        wmask = {fds_bits = {0, 0}}
        timeout = (struct timeval *) 0x0
        timeout_tv = {tv_sec = 0, tv_usec = 0}
---Type <return> to continue, or q <return> to quit---
        readmask = {fds_bits = {8, 0}}
        writemask = {fds_bits = {0, 0}}
        nSockets = 4
        curr = (Dlelem *) 0x10000000
        now = {tv_sec = 1010605539, tv_usec = 604000}
        later = {tv_sec = 1010605539, tv_usec = 614000}
        tz = {tz_minuteswest = 300, tz_dsttime = 1}

postmaster.c:905
#ifdef HAVE_UNIX_SOCKETS
		if (ServerSock_UNIX != INVALID_SOCK &&
			FD_ISSET(ServerSock_UNIX, &rmask) &&
			(port = ConnCreate(ServerSock_UNIX)) != NULL)
		{
			PacketReceiveSetup(&port->pktInfo,
							   readStartupPacket,
							   (void *) port);
		}
#endif

		if (ServerSock_INET != INVALID_SOCK &&
			FD_ISSET(ServerSock_INET, &rmask) &&
			(port = ConnCreate(ServerSock_INET)) != NULL)
		{
			PacketReceiveSetup(&port->pktInfo,
							   readStartupPacket,
							   (void *) port);
		}

		/*
		 * Scan active ports, processing any available input.  While we
		 * are at it, build up new masks for next select().
		 */
		nSockets = initMasks(&readmask, &writemask);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]