- Fix a build error on Haiku.
- Do the version number the same way as in tcpdump and libpcap.
- Lose unused missing/strlcpy.c.
+- Use posix_fadvise() on input files if available.
v1.6 Thu 20 Oct 21:22:28 BST 2022
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
+# Haiku, OpenBSD, Solaris 9 and Solaris 10 don't have posix_fadvise().
+AC_CHECK_FUNCS([posix_fadvise])
+
AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
AC_MSG_CHECKING([whether to enable the instrument functions code])
s->p = pcap_open_offline(s->filename, errbuf);
if (! s->p)
error( "bad pcap file %s: %s", s->filename, errbuf );
+
+#ifdef HAVE_POSIX_FADVISE
+ int padv_err, fd = fileno(pcap_file(s->p));
+ if (0 != (padv_err = posix_fadvise(fd, 0, 0, POSIX_FADV_RANDOM)))
+ warning("warning: posix_fadvise() failed: %s", strerror(padv_err));
+ if (0 != (padv_err = posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE)))
+ warning("warning: posix_fadvise() failed: %s", strerror(padv_err));
+#endif
+
if (track_sessions)
sessions_nids_init(s->p);