#include <time.h> /* ctime */
#include <timeconv.h> /* _long_to_time */
#include <unistd.h>
+/*
+ * FreeBSD uses __unused as a shorthand for __attribute__ ((__unused__))
+ * whereas Linux sometimes uses __unused as a variable name.
+ * undefine the macro around problematic places.
+ */
+#undef __unused
#include <fcntl.h>
+#define __unused __attribute__ ((__unused__))
#include <net/ethernet.h>
#include <net/if.h> /* only IFNAMSIZ */