According to POSIX.1-2001, POSIX.1-2008 #include <sys/select.h> is correct way to get fd_set
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
@@ -35,10 +36,6 @@
|
||||
#include <dns/result.h>
|
||||
#include <dns/zone.h>
|
||||
|
||||
#ifdef ISC_PLATFORM_NEEDSYSSELECTH
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
static int debug = 0;
|
||||
static int quiet = 0;
|
||||
static int stats = 0;
|
||||
|
||||
53
configure
vendored
53
configure
vendored
@@ -765,7 +765,6 @@ ax_pthread_config
|
||||
CHECK_DSA
|
||||
GEOIPLINKOBJS
|
||||
GEOIPLINKSRCS
|
||||
ISC_PLATFORM_NEEDSYSSELECTH
|
||||
ISC_PLATFORM_HAVEDEVPOLL
|
||||
ISC_PLATFORM_HAVEEPOLL
|
||||
ISC_PLATFORM_HAVEKQUEUE
|
||||
@@ -14003,58 +14002,6 @@ done
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# check if we need to #include sys/select.h explicitly
|
||||
#
|
||||
case $ac_cv_header_unistd_h in
|
||||
yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if unistd.h or sys/types.h defines fd_set" >&5
|
||||
$as_echo_n "checking if unistd.h or sys/types.h defines fd_set... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/types.h> /* Ultrix */
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
fd_set read_set; return (0);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
case $ac_cv_header_sys_select_h in
|
||||
yes)
|
||||
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
|
||||
;;
|
||||
no)
|
||||
as_fn_error $? "need either working unistd.h or sys/select.h" "$LINENO" 5
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
;;
|
||||
no)
|
||||
case $ac_cv_header_sys_select_h in
|
||||
yes)
|
||||
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1"
|
||||
;;
|
||||
no)
|
||||
as_fn_error $? "need either unistd.h or sys/select.h" "$LINENO" 5
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# Find the machine's endian flavor.
|
||||
#
|
||||
|
||||
36
configure.in
36
configure.in
@@ -609,42 +609,6 @@ yes)
|
||||
esac
|
||||
AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
|
||||
|
||||
#
|
||||
# check if we need to #include sys/select.h explicitly
|
||||
#
|
||||
case $ac_cv_header_unistd_h in
|
||||
yes)
|
||||
AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set)
|
||||
AC_TRY_COMPILE([
|
||||
#include <sys/types.h> /* Ultrix */
|
||||
#include <unistd.h>],
|
||||
[fd_set read_set; return (0);],
|
||||
[AC_MSG_RESULT(yes)
|
||||
ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"],
|
||||
[AC_MSG_RESULT(no)
|
||||
case $ac_cv_header_sys_select_h in
|
||||
yes)
|
||||
ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_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"
|
||||
;;
|
||||
no)
|
||||
AC_MSG_ERROR([need either unistd.h or sys/select.h])
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH)
|
||||
|
||||
#
|
||||
# Find the machine's endian flavor.
|
||||
#
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
*** Network.
|
||||
***/
|
||||
|
||||
/*! \brief
|
||||
* Define if the system has struct lifconf which is a extended struct ifconf
|
||||
* for IPv6.
|
||||
*/
|
||||
@ISC_PLATFORM_HAVELIFCONF@
|
||||
|
||||
/*! \brief
|
||||
* Define if the system has TCP_FASTOPEN socket option.
|
||||
*/
|
||||
@@ -69,11 +75,6 @@
|
||||
*** Miscellaneous.
|
||||
***/
|
||||
|
||||
/*
|
||||
* Defined if unistd.h does not cause fd_set to be delared.
|
||||
*/
|
||||
@ISC_PLATFORM_NEEDSYSSELECTH@
|
||||
|
||||
/*
|
||||
* Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
|
||||
* the GSSAPI header.
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
|
||||
/*! \file */
|
||||
|
||||
#ifdef ISC_PLATFORM_NEEDSYSSELECTH
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
|
||||
typedef struct isc_socketwait isc_socketwait_t;
|
||||
int isc__socketmgr_waitevents(isc_socketmgr_t *, struct timeval *,
|
||||
|
||||
Reference in New Issue
Block a user