fi
-for ac_hdr in fcntl.h sys/time.h unistd.h
+for ac_hdr in sys/poll.h fcntl.h sys/time.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
+AC_CHECK_HEADERS(sys/poll.h fcntl.h sys/time.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
#include <errno.h>
#include <fcntl.h>
-#include <sys/poll.h>
+
+#ifdef HAVE_SYS_POLL_H
+# include <sys/poll.h>
+#endif
#include "config.h"
#include "irc.h"
void scan_check()
{
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
static struct pollfd ufds[MAX_POLL]; /* MAX_POLL is defined in options.h */
int i;
unsigned long size;
fd_set r_fdset;
struct timeval scan_timeout;
int highfd = 0;
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
struct scan_struct *ss;
return;
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
size = 0;
scan_timeout.tv_sec = 0; /* No timeout */
scan_timeout.tv_usec = 0;
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
switch(poll(ufds, size, 0))
#else /* select() */
switch(select((highfd + 1), &r_fdset, &w_fdset, 0, &scan_timeout))
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
{
case -1:
/* Pass pointer to connection to handler */
default:
-#ifdef USE_POLL
+#ifdef HAVE_SYS_POLL_H
for(ss = CONNECTIONS; ss; ss = ss->next)
{
for(i = 0; i < size; i++)
if(FD_ISSET(ss->fd, &w_fdset))
scan_writeready(ss);
}
-#endif /* USE_POLL */
+#endif /* HAVE_SYS_POLL_H */
}
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H