]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tests/TESTrun
Add --time-t-size option to print the size of time_t in bits
[tcpdump] / tests / TESTrun
index e7bf6ce1b2930c74321a7445609d355554e1114c..eeffa6238c4283caefb41eb30b8fabfff2a8f8fc 100755 (executable)
@@ -390,6 +390,17 @@ sub loadconfighash {
     printf "$TCPDUMP --fp-type => %s\n", $have_fptype;
     $main::confighhash->{$have_fptype} = 1;
 
+    # run tcpdump --time-t-size to get the size of size_t in bits
+    open(TIMETSIZE_PIPE, "$TCPDUMP --time-t-size |") or die("piping tcpdump --time-t-size failed\n");
+    my $time_t_size = <TIMETSIZE_PIPE>;
+    close(TIMETSIZE_PIPE);
+    my $have_time_t_64;
+    if($time_t_size == "64") {
+        $have_time_t_64 = "HAVE_TIME_T_64";
+    }
+    printf "$TCPDUMP --time-t-size => %s\n", $time_t_size;
+    $main::confighhash->{$have_time_t_64} = 1;
+
     # and check whether this is OpenBSD, as one test fails in OpenBSD
     # due to the sad hellscape of low-numbered DLT_ values, due to
     # 12 meaning "OpenBSD loopback" rather than "raw IP" on OpenBSD