From: Andreas Gustafsson Date: Thu, 14 Jun 2001 13:37:47 +0000 (+0000) Subject: pullup: X-Git-Tag: v9.1.3rc2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=786ca5121bf0ec557d526020813efd22aa01e2f8;p=thirdparty%2Fbind9.git pullup: 703. [port] sys/select.h is needed on older platforms. [RT #695] --- diff --git a/CHANGES b/CHANGES index 2a98abdb5ed..277dc250dfd 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,8 @@ 704. [port] RLIMIT_NOFILE is not available on all platforms. + 703. [port] sys/select.h is needed on older platforms. [RT #695] + --- 9.1.3rc1 released --- 831. [bug] The configure script tried to determine diff --git a/configure.in b/configure.in index ed94b096228..c96581be13e 100644 --- a/configure.in +++ b/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.205.2.8 $) +AC_REVISION($Revision: 1.205.2.9 $) AC_INIT(lib/dns/name.c) AC_PREREQ(2.13) @@ -301,13 +301,51 @@ AC_C_BIGENDIAN AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h) +AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h) AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_HEADER_TIME +# +# check if we need to #include sys/select.h explicitly +# +case $ac_cv_header_unistd_h in +yes) +AC_MSG_CHECKING(if unistd.h defines fd_set) +AC_TRY_COMPILE([ +#include ], +[fd_set read_set; return (0);], + [AC_MSG_RESULT(yes) + ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH" + LWRES_PLATFORM_NEEDSYSSELECTH="#undef LWRES_PLATFORM_NEEDSYSSELECTH"], + [AC_MSG_RESULT(no) + case ac_cv_header_sys_select_h in + yes) + ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" + LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1" + ;; + no) + AC_MSG_ERROR(["need either working unistd.h or sys/select.h"]) + ;; + esac + ]) + ;; +no) + case ac_cv_header_sys_select_h in + yes) + ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" + LWRES_PLATFORM_NEEDSYSSELECTH="#define LWRES_PLATFORM_NEEDSYSSELECTH 1" + ;; + no) + AC_MSG_ERROR(["need either unistd.h or sys/select.h"]) + ;; + esac + ;; +esac +AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH) +AC_SUBST(LWRES_PLATFORM_NEEDSYSSELECTH) # # Begin pthreads checking. # diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index 0b30ffa157d..767c4c23e5e 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: platform.h.in,v 1.16.4.3 2001/06/09 00:53:22 gson Exp $ */ +/* $Id: platform.h.in,v 1.16.4.4 2001/06/14 13:37:45 gson Exp $ */ #ifndef ISC_PLATFORM_H #define ISC_PLATFORM_H 1 @@ -137,6 +137,11 @@ */ @ISC_PLATFORM_RLIMITTYPE@ +/* + * Defined if unistd.h does not cause fd_set to be delared. + */ +@ISC_PLATFORM_NEEDSYSSELECTH@ + /* * Tell emacs to use C mode for this file. * diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c index 928e0c55e0d..1bb36d01742 100644 --- a/lib/isc/unix/entropy.c +++ b/lib/isc/unix/entropy.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: entropy.c,v 1.54.2.3 2001/04/10 00:24:47 gson Exp $ */ +/* $Id: entropy.c,v 1.54.2.4 2001/06/14 13:37:47 gson Exp $ */ #include @@ -34,12 +34,17 @@ #include #include #include +#include #include #include #include #include #include +#ifdef ISC_PLATFORM_NEEDSYSSELECTH +#include +#endif + /* * Much of this code is modeled after the NetBSD /dev/random implementation, * written by Michael Graff . diff --git a/lib/isc/unix/socket_p.h b/lib/isc/unix/socket_p.h index f535a4d0763..ff55f8fdcee 100644 --- a/lib/isc/unix/socket_p.h +++ b/lib/isc/unix/socket_p.h @@ -15,13 +15,17 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket_p.h,v 1.2.4.1 2001/01/09 22:51:26 bwelling Exp $ */ +/* $Id: socket_p.h,v 1.2.4.2 2001/06/14 13:37:46 gson Exp $ */ /* ISC_PLATFORM_USETHREADS_DELETE */ #ifndef ISC_SOCKET_P_H #define ISC_SOCKET_P_H +#ifdef ISC_PLATFORM_NEEDSYSSELECTH +#include +#endif + void isc__socketmgr_getfdsets(fd_set *readset, fd_set *writeset, int *maxfd);