From 4fff1dada7bbaf36fea5330b641bc464566d48f2 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Tue, 13 Oct 1998 20:44:49 +0000 Subject: [PATCH] From: Peter Gucwa Here are patches needed to complie under AIX 4.2. I changed configure.in, pqcomm.c, config.h.in, and fe-connect.c. Also I had to install flex because lex did not want to translate pgc.l. --- src/backend/libpq/pqcomm.c | 10 +- src/configure | 318 ++++++++++++++++-------------- src/configure.in | 9 + src/include/config.h.in | 3 + src/interfaces/libpq/fe-connect.c | 4 +- 5 files changed, 193 insertions(+), 151 deletions(-) diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c index 31e6f982c4..04ebddb5e6 100644 --- a/src/backend/libpq/pqcomm.c +++ b/src/backend/libpq/pqcomm.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.56 1998/10/07 03:45:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v 1.57 1998/10/13 20:44:40 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -653,8 +653,8 @@ StreamServerPort(char *hostName, short portName, int *fdP) int StreamConnection(int server_fd, Port *port) { - int len, - addrlen; + int len; + SOCKET_SIZE_TYPE addrlen; int family = port->raddr.sa.sa_family; /* accept connection (and fill in the client (remote) address) */ @@ -725,8 +725,8 @@ StreamClose(int sock) int StreamOpen(char *hostName, short portName, Port *port) { - int len, - err; + SOCKET_SIZE_TYPE len; + int err; struct hostent *hp; extern int errno; diff --git a/src/configure b/src/configure index 37df322805..122d06f665 100755 --- a/src/configure +++ b/src/configure @@ -3641,17 +3641,47 @@ EOF fi -echo $ac_n "checking for int timezone""... $ac_c" 1>&6 -echo "configure:3646: checking for int timezone" >&5 +echo $ac_n "checking for type of last arg to accept""... $ac_c" 1>&6 +echo "configure:3646: checking for type of last arg to accept" >&5 cat > conftest.$ac_ext < +#include +#include + +int main() { +int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); +; return 0; } +EOF +if { (eval echo configure:3658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define SOCKET_SIZE_TYPE size_t +EOF + echo "$ac_t""size_t" 1>&6 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define SOCKET_SIZE_TYPE int +EOF + echo "$ac_t""int" 1>&6 +fi +rm -f conftest* + +echo $ac_n "checking for int timezone""... $ac_c" 1>&6 +echo "configure:3676: checking for int timezone" >&5 +cat > conftest.$ac_ext < int main() { int res = timezone / 60; ; return 0; } EOF -if { (eval echo configure:3655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_INT_TIMEZONE 1 @@ -3666,16 +3696,16 @@ fi rm -f conftest* echo $ac_n "checking for gettimeofday args""... $ac_c" 1>&6 -echo "configure:3670: checking for gettimeofday args" >&5 +echo "configure:3700: checking for gettimeofday args" >&5 cat > conftest.$ac_ext < int main() { struct timeval *tp; struct timezone *tzp; gettimeofday(tp,tzp); ; return 0; } EOF -if { (eval echo configure:3679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY_2_ARGS 1 @@ -3690,9 +3720,9 @@ fi rm -f conftest* echo $ac_n "checking for union semun""... $ac_c" 1>&6 -echo "configure:3694: checking for union semun" >&5 +echo "configure:3724: checking for union semun" >&5 cat > conftest.$ac_ext < #include @@ -3701,7 +3731,7 @@ int main() { union semun semun; ; return 0; } EOF -if { (eval echo configure:3705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UNION_SEMUN 1 @@ -3716,9 +3746,9 @@ fi rm -f conftest* echo $ac_n "checking for fcntl(F_SETLK)""... $ac_c" 1>&6 -echo "configure:3720: checking for fcntl(F_SETLK)" >&5 +echo "configure:3750: checking for fcntl(F_SETLK)" >&5 cat > conftest.$ac_ext < int main() { @@ -3728,7 +3758,7 @@ struct flock lck; fcntl(0, F_SETLK, &lck); ; return 0; } EOF -if { (eval echo configure:3732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_FCNTL_SETLK 1 @@ -3743,12 +3773,12 @@ fi rm -f conftest* echo $ac_n "checking for good DBL_MIN""... $ac_c" 1>&6 -echo "configure:3747: checking for good DBL_MIN" >&5 +echo "configure:3777: checking for good DBL_MIN" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""assuming ok on target machine" 1>&6 else cat > conftest.$ac_ext < #include @@ -3757,7 +3787,7 @@ else #endif main() { double d = DBL_MIN; if (d != DBL_MIN) exit(-1); else exit(0); } EOF -if { (eval echo configure:3761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 else @@ -3774,12 +3804,12 @@ fi echo $ac_n "checking whether 'long int' is 64 bits""... $ac_c" 1>&6 -echo "configure:3778: checking whether 'long int' is 64 bits" >&5 +echo "configure:3808: checking whether 'long int' is 64 bits" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""assuming not on target machine" 1>&6 else cat > conftest.$ac_ext < typedef long int int64; @@ -3814,7 +3844,7 @@ main() { exit(! does_int64_work()); } EOF -if { (eval echo configure:3818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define HAVE_LONG_INT_64 1 @@ -3831,12 +3861,12 @@ fi echo $ac_n "checking whether 'long long int' is 64 bits""... $ac_c" 1>&6 -echo "configure:3835: checking whether 'long long int' is 64 bits" >&5 +echo "configure:3865: checking whether 'long long int' is 64 bits" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""assuming not on target machine" 1>&6 else cat > conftest.$ac_ext < typedef long long int int64; @@ -3871,7 +3901,7 @@ main() { exit(! does_int64_work()); } EOF -if { (eval echo configure:3875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define HAVE_LONG_LONG_INT_64 1 @@ -3889,13 +3919,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:3893: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:3923: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -3913,7 +3943,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -3935,7 +3965,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:3939: checking for 8-bit clean memcmp" >&5 +echo "configure:3969: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3943,7 +3973,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -3971,12 +4001,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:3975: checking return type of signal handlers" >&5 +echo "configure:4005: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3993,7 +4023,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:3997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -4012,12 +4042,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:4016: checking for vprintf" >&5 +echo "configure:4046: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -4064,12 +4094,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:4068: checking for _doprnt" >&5 +echo "configure:4098: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -4119,12 +4149,12 @@ fi for ac_func in tzset memmove sigsetjmp kill sysconf fpclass do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4123: checking for $ac_func" >&5 +echo "configure:4153: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4174,12 +4204,12 @@ done for ac_func in fp_class fp_class_d class do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4178: checking for $ac_func" >&5 +echo "configure:4208: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4229,12 +4259,12 @@ done for ac_func in sigprocmask waitpid setsid fcvt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4233: checking for $ac_func" >&5 +echo "configure:4263: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4282,12 +4312,12 @@ fi done echo $ac_n "checking for snprintf""... $ac_c" 1>&6 -echo "configure:4286: checking for snprintf" >&5 +echo "configure:4316: checking for snprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_snprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_snprintf=yes" else @@ -4335,12 +4365,12 @@ fi echo $ac_n "checking for isinf""... $ac_c" 1>&6 -echo "configure:4339: checking for isinf" >&5 +echo "configure:4369: checking for isinf" >&5 if eval "test \"`echo '$''{'ac_cv_func_isinf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_isinf=yes" else @@ -4388,12 +4418,12 @@ fi echo $ac_n "checking for getrusage""... $ac_c" 1>&6 -echo "configure:4392: checking for getrusage" >&5 +echo "configure:4422: checking for getrusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_getrusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_getrusage=yes" else @@ -4441,12 +4471,12 @@ fi echo $ac_n "checking for srandom""... $ac_c" 1>&6 -echo "configure:4445: checking for srandom" >&5 +echo "configure:4475: checking for srandom" >&5 if eval "test \"`echo '$''{'ac_cv_func_srandom'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_srandom=yes" else @@ -4494,12 +4524,12 @@ fi echo $ac_n "checking for gethostname""... $ac_c" 1>&6 -echo "configure:4498: checking for gethostname" >&5 +echo "configure:4528: checking for gethostname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostname=yes" else @@ -4547,12 +4577,12 @@ fi echo $ac_n "checking for random""... $ac_c" 1>&6 -echo "configure:4551: checking for random" >&5 +echo "configure:4581: checking for random" >&5 if eval "test \"`echo '$''{'ac_cv_func_random'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_random=yes" else @@ -4600,12 +4630,12 @@ fi echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:4604: checking for inet_aton" >&5 +echo "configure:4634: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -4653,12 +4683,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:4657: checking for strerror" >&5 +echo "configure:4687: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -4707,12 +4737,12 @@ fi echo $ac_n "checking for strdup""... $ac_c" 1>&6 -echo "configure:4711: checking for strdup" >&5 +echo "configure:4741: checking for strdup" >&5 if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strdup=yes" else @@ -4760,12 +4790,12 @@ fi echo $ac_n "checking for strtol""... $ac_c" 1>&6 -echo "configure:4764: checking for strtol" >&5 +echo "configure:4794: checking for strtol" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtol'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strtol=yes" else @@ -4813,12 +4843,12 @@ fi echo $ac_n "checking for strtoul""... $ac_c" 1>&6 -echo "configure:4817: checking for strtoul" >&5 +echo "configure:4847: checking for strtoul" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strtoul=yes" else @@ -4866,12 +4896,12 @@ fi echo $ac_n "checking for strcasecmp""... $ac_c" 1>&6 -echo "configure:4870: checking for strcasecmp" >&5 +echo "configure:4900: checking for strcasecmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcasecmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strcasecmp=yes" else @@ -4919,12 +4949,12 @@ fi echo $ac_n "checking for cbrt""... $ac_c" 1>&6 -echo "configure:4923: checking for cbrt" >&5 +echo "configure:4953: checking for cbrt" >&5 if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_cbrt=yes" else @@ -4968,7 +4998,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6 -echo "configure:4972: checking for cbrt in -lm" >&5 +echo "configure:5002: checking for cbrt in -lm" >&5 ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4976,7 +5006,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5013,12 +5043,12 @@ fi fi echo $ac_n "checking for rint""... $ac_c" 1>&6 -echo "configure:5017: checking for rint" >&5 +echo "configure:5047: checking for rint" >&5 if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_rint=yes" else @@ -5068,7 +5098,7 @@ if [ -r /lib/pa1.1/libm.a ] ; then SPECIALMATHLIB="-L /lib/pa1.1 -lm" fi echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6 -echo "configure:5072: checking for rint in -lm" >&5 +echo "configure:5102: checking for rint in -lm" >&5 ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5076,7 +5106,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $SPECIALMATHLIB $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5127,7 +5157,7 @@ if test "$USE_X" = true; then # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:5131: checking for X" >&5 +echo "configure:5161: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -5189,12 +5219,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5198: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5263,14 +5293,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -5376,17 +5406,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:5380: checking whether -R must be followed by a space" >&5 +echo "configure:5410: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_nospace=yes else @@ -5402,14 +5432,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_R_space=yes else @@ -5441,7 +5471,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:5445: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:5475: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5449,7 +5479,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5482,7 +5512,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:5486: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:5516: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5490,7 +5520,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5530,12 +5560,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:5534: checking for gethostbyname" >&5 +echo "configure:5564: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -5579,7 +5609,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:5583: checking for gethostbyname in -lnsl" >&5 +echo "configure:5613: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5587,7 +5617,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5628,12 +5658,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:5632: checking for connect" >&5 +echo "configure:5662: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -5677,7 +5707,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:5681: checking for connect in -lsocket" >&5 +echo "configure:5711: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5685,7 +5715,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5720,12 +5750,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:5724: checking for remove" >&5 +echo "configure:5754: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -5769,7 +5799,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:5773: checking for remove in -lposix" >&5 +echo "configure:5803: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5777,7 +5807,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5812,12 +5842,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5816: checking for shmat" >&5 +echo "configure:5846: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -5861,7 +5891,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5865: checking for shmat in -lipc" >&5 +echo "configure:5895: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5869,7 +5899,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5913,7 +5943,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:5917: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:5947: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5921,7 +5951,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5965,7 +5995,7 @@ fi X11_LIBS="" echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 -echo "configure:5969: checking for XOpenDisplay in -lX11" >&5 +echo "configure:5999: checking for XOpenDisplay in -lX11" >&5 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5973,7 +6003,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lX11 ${X_PRE_LIBS} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6022,7 +6052,7 @@ fi if test "$USE_TCL"; then echo $ac_n "checking for tclConfig.sh""... $ac_c" 1>&6 -echo "configure:6026: checking for tclConfig.sh" >&5 +echo "configure:6056: checking for tclConfig.sh" >&5 library_dirs="$LIBRARY_DIRS /usr/lib" TCL_CONFIG_SH= for dir in $library_dirs; do @@ -6051,7 +6081,7 @@ fi if test "$USE_TCL"; then echo $ac_n "checking for tkConfig.sh""... $ac_c" 1>&6 -echo "configure:6055: checking for tkConfig.sh" >&5 +echo "configure:6085: checking for tkConfig.sh" >&5 library_dirs="$LIBRARY_DIRS /usr/lib" TK_CONFIG_SH= for dir in $library_dirs; do @@ -6087,17 +6117,17 @@ then PWD_INCDIR=no ac_safe=`echo "pwd.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for pwd.h""... $ac_c" 1>&6 -echo "configure:6091: checking for pwd.h" >&5 +echo "configure:6121: checking for pwd.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6131: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* diff --git a/src/configure.in b/src/configure.in index 23b159f280..94c75d75a0 100644 --- a/src/configure.in +++ b/src/configure.in @@ -548,6 +548,15 @@ AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM +AC_MSG_CHECKING(for type of last arg to accept) +AC_TRY_COMPILE([#include +#include +#include +], +[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0);], +[AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)], +[AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)]) + dnl Check for any "odd" conditions AC_MSG_CHECKING(for int timezone) AC_TRY_LINK([#include ], diff --git a/src/include/config.h.in b/src/include/config.h.in index 7b1ddbecc3..f5f0373c09 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -260,6 +260,9 @@ extern void srandom(int seed); /* Set to 1 if type "long long int" works and is 64 bits */ #undef HAVE_LONG_LONG_INT_64 +/* Define as the base type of the last arg to accept */ +#undef SOCKET_SIZE_TYPE + /* * Code below this point should not require changes */ diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 3a2b16c22d..998ced9876 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.84 1998/10/01 01:40:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.85 1998/10/13 20:44:49 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -503,7 +503,7 @@ connectDB(PGconn *conn) struct hostent *hp; StartupPacket sp; AuthRequest areq; - int laddrlen; + SOCKET_SIZE_TYPE laddrlen; int portno, family; char beresp; -- GitLab