e-mail address while we're at it.
Use <fcntl.h> rather than <sys/file.h> in pcap-bpf.c - that's the right
header for open().
Don't include <sys/timeb.h> - it doesn't define anything that pcap-bpf.c
should need.
Chris Pepper <pepper at mail dot reppep dot com>
Christian Peron <csjp at freebsd dot org>
Daniele Orlandi <daniele at orlandi dot com>
- Darren Reed <darrenr at reed dot wattle dot id dot au>
+ Darren Reed <darrenr at sun dot com>
David Kaelbling <drk at sgi dot com>
David Young <dyoung at ojctech dot com>
Dean Gaudet <dean at arctic dot org>
# We check for odmi.h instead.
#
V_PCAP=bpf
-elif test -r /usr/include/sys/dlpi.h ; then
- V_PCAP=dlpi
elif test -c /dev/bpf0 ; then # check again in case not readable
V_PCAP=bpf
+elif test -r /usr/include/sys/dlpi.h ; then
+ V_PCAP=dlpi
elif test -c /dev/enet ; then # check again in case not readable
V_PCAP=enet
elif test -c /dev/nit ; then # check again in case not readable
AC_FUNC_FSEEKO
dnl
-dnl libpcap doesn't itself use <sys/ioccom.h>; however, the test program
-dnl in "AC_LBL_FIXINCLUDES" in "aclocal.m4" uses it, so we have to
-dnl test for it and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
-dnl "AC_LBL_FIXINCLUDES" won't work on some platforms such as Solaris.
+dnl Even if <net/bpf.h> were, on all OSes that support BPF, fixed to
+dnl include <sys/ioccom.h>, and we were to drop support for older
+dnl releases without that fix, so that pcap-bpf.c doesn't need to
+dnl include <sys/ioccom.h>, the test program in "AC_LBL_FIXINCLUDES"
+dnl in "aclocal.m4" uses it, so we would still have to test for it
+dnl and set "HAVE_SYS_IOCCOM_H" if we have it, otherwise
+dnl "AC_LBL_FIXINCLUDES" wouldn't work on some platforms such as Solaris.
dnl
AC_CHECK_HEADERS(sys/ioccom.h sys/sockio.h limits.h paths.h)
AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
# We check for odmi.h instead.
#
V_PCAP=bpf
-elif test -r /usr/include/sys/dlpi.h ; then
- V_PCAP=dlpi
elif test -c /dev/bpf0 ; then # check again in case not readable
V_PCAP=bpf
+elif test -r /usr/include/sys/dlpi.h ; then
+ V_PCAP=dlpi
elif test -c /dev/enet ; then # check again in case not readable
V_PCAP=enet
elif test -c /dev/nit ; then # check again in case not readable
#include <sys/mman.h>
#endif
#include <sys/time.h>
-#include <sys/timeb.h>
#include <sys/socket.h>
-#include <sys/file.h>
+/*
+ * <net/bpf.h> defines ioctls, but doesn't include <sys/ioccom.h>.
+ *
+ * We include <sys/ioctl.h> as it might be necessary to declare ioctl();
+ * at least on *BSD and Mac OS X, it also defines various SIOC ioctls -
+ * we could include <sys/sockio.h>, but if we're already including
+ * <sys/ioctl.h>, which includes <sys/sockio.h> on those platforms,
+ * there's not much point in doing so.
+ *
+ * If we have <sys/ioccom.h>, we include it as well, to handle systems
+ * such as Solaris which don't arrange to include <sys/ioccom.h> if you
+ * include <sys/ioctl.h>
+ */
#include <sys/ioctl.h>
+#ifdef HAVE_SYS_IOCCOM_H
+#include <sys/ioccom.h>
+#endif
#include <sys/utsname.h>
#ifdef HAVE_ZEROCOPY_BPF
#endif /* _AIX */
#include <ctype.h>
+#include <fcntl.h>
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
case EWOULDBLOCK:
return (0);
-#if defined(sun) && !defined(BSD)
+#if defined(sun) && !defined(BSD) && !defined(__svr4__) && !defined(__SVR4)
/*
* Due to a SunOS bug, after 2^31 bytes, the kernel
* file offset overflows and read fails with EINVAL.