Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0f07d64

Browse files
committed
The configure script fails to find <netinet/tcp.h>.
As a result, backend/libpq/pqcomm.c and interfaces/libpq/fe-connect.c fail to compile. The <netinet/tcp.h> header needs to be preceded by <netinet/in.h>, at least on IRIX, Solaris and AIX. The simple configure test fails. (That header on Linux is idempotent.) The basic problem is that <netinet/tcp.h> is a BSD header. The correct header for TCP internals such as TCP_NODELAY on a UNIX system is <xti.h>. By UNIX I mean UNIX95 (aka XPG4v2 or SUSv1) or later. The current UNIX standard (UNIX98 aka SUSv2) is available online at <http://www.opengroup.org/onlinepubs/7908799/>. The fix is to add header support for <xti.h> into configure.in and config.h.in. The 2 files which conditionally include <netinet/tcp.h> need also to conditionally include <xti.h>. Pete Forman
1 parent d390219 commit 0f07d64

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ fi
654654
## Header files
655655
##
656656
dnl sys/socket.h and sys/types.h are required by AC_FUNC_ACCEPT_ARGTYPES
657-
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h netinet/tcp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/types.h sys/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h])
657+
AC_CHECK_HEADERS([crypt.h dld.h endian.h fp_class.h getopt.h ieeefp.h xti.h netinet/tcp.h pwd.h sys/ipc.h sys/pstat.h sys/select.h sys/sem.h sys/socket.h sys/shm.h sys/types.h sys/un.h termios.h kernel/OS.h kernel/image.h SupportDefs.h])
658658

659659
AC_CHECK_HEADERS([readline/readline.h readline.h], [break])
660660
AC_CHECK_HEADERS([readline/history.h history.h], [break])

src/backend/libpq/pqcomm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3030
* Portions Copyright (c) 1994, Regents of the University of California
3131
*
32-
* $Id: pqcomm.c,v 1.105 2000/10/05 20:18:33 tgl Exp $
32+
* $Id: pqcomm.c,v 1.106 2000/10/14 23:56:58 momjian Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -69,6 +69,9 @@
6969
#include <sys/socket.h>
7070
#include <netdb.h>
7171
#include <netinet/in.h>
72+
#ifdef HAVE_XTI_H
73+
# include <xti.h>
74+
#endif
7275
#ifdef HAVE_NETINET_TCP_H
7376
# include <netinet/tcp.h>
7477
#endif

src/include/config.h.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in config.h afterwards. Of course, if you edit config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: config.h.in,v 1.141 2000/10/07 14:39:16 momjian Exp $
11+
* $Id: config.h.in,v 1.142 2000/10/14 23:56:58 momjian Exp $
1212
*/
1313

1414
#ifndef CONFIG_H
@@ -330,6 +330,9 @@
330330
/* Set to 1 if you have <ieeefp.h> */
331331
#undef HAVE_IEEEFP_H
332332

333+
/* Set to 1 if you have <xti.h> */
334+
#undef HAVE_XTI_H
335+
333336
/* Set to 1 if you have <netinet/tcp.h> */
334337
#undef HAVE_NETINET_TCP_H
335338

src/interfaces/libpq/fe-connect.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.137 2000/10/03 19:16:17 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.138 2000/10/14 23:56:59 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -31,6 +31,9 @@
3131
#include <unistd.h>
3232
#include <netdb.h>
3333
#include <netinet/in.h>
34+
#ifdef HAVE_XTI_H
35+
# include <xti.h>
36+
#endif
3437
#ifdef HAVE_NETINET_TCP_H
3538
# include <netinet/tcp.h>
3639
#endif

0 commit comments

Comments
 (0)