+/* On SVR4, this #define is necessary to make <sys/ioctl.h> define
+ many of the ioctls. */
+#define BSD_COMP
+
#include <sys/types.h>
#include <sys/param.h>
So we include <sys/termios.h> and let <sys/ioctl.h> redefine things.
This produces some spurious warnings. */
-#ifdef HAVE_SYS_TERMIOS_H
+#ifdef HAVE_sys_termios_h
#include <sys/termios.h>
#endif
#include <net/if_arp.h>
#endif
#ifdef SIOCGNIT
+#ifdef HAVE_net_nit_h
#include <net/nit.h>
-#endif
-#endif
+#else /* No net/nit.h. */
+#undef SIOCGNIT
+#undef SIOCSNIT
+#endif /* net/nit.h. */
+#endif /* SIOCGNIT. */
+#endif /* SIOCGIFCONF. */
/* These exist on Sequents. */
#ifdef SMIOSTATS
/* These exist under Ultrix, but I figured there may be others. */
#ifdef DIOCGETPT
-#include <ufs/fs.h> /* for DIOC* */
+#include <ufs/fs.h> /* for DIOC* */
#endif
#ifdef DEVGETGEOM
#include <sys/devio.h>
#undef MTIOCGET
#endif
+#if defined(__osf__) && defined(__alpha__)
+#include <sys/ioctl_compat.h> /* To get TIOCGETP, etc. */
+#include <alpha/pt.h> /* for DIOC* */
+#include <sys/mtio.h> /* for MTIOC* */
+/* The binlog_getstatus structure doesn't seem to be defined. */
+#undef BINLOG_GETSTATUS
+/* Can't find `struct ifdata' anywhere. */
+#undef SIOCMANREQ
+#undef SIOCGETEVENTS
+/* OSF/1 smells an awful lot like Ultrix. */
+#undef TCGETA
+#undef TCSETA
+#undef TCSETAF
+#undef TCSETAW
+/* This macro looks screwed in sys/devio.h. */
+#undef DEV_DISKPART
+/* This is in sys/dkio.h, but we don't need it. */
+#undef DKIOCACC
+#undef DKIOCDOP
+#undef DKIOCEXCL
+#undef DKIOCGET
+#undef DKIOCHDR
+/* Introduced by OSF/1 2.0. */
+#undef FIOPIPESTAT
+#undef SIOCSRREQR
+#undef SIOCSRREQW
+#undef SRVC_REQUEST
+#endif
+
#define DEFINE(name, value) \
printf("#define %s 0x%.8x\n", (name), (value))