aboutsummaryrefslogtreecommitdiffstats
path: root/sf-pcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sf-pcap.c')
-rw-r--r--sf-pcap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sf-pcap.c b/sf-pcap.c
index 6903160..9d55dae 100644
--- a/sf-pcap.c
+++ b/sf-pcap.c
@@ -68,6 +68,19 @@ static const char rcsid[] _U_ =
#include "sf-pcap.h"
/*
+ * Setting O_BINARY on DOS/Windows is a bit tricky
+ */
+#if defined(WIN32)
+ #define SET_BINMODE(f) _setmode(_fileno(f), _O_BINARY)
+#elif defined(MSDOS)
+ #if defined(__HIGHC__)
+ #define SET_BINMODE(f) setmode(f, O_BINARY)
+ #else
+ #define SET_BINMODE(f) setmode(fileno(f), O_BINARY)
+ #endif
+#endif
+
+/*
* Standard libpcap format.
*/
#define TCPDUMP_MAGIC 0xa1b2c3d4