statzone

DNS zone file analyzer targeted at TLD zones
Log | Files | Refs | README | LICENSE

compat.h (548B)


      1 #ifndef COMPAT_H
      2 #define COMPAT_H
      3 
      4 #ifndef HAVE_PLEDGE
      5 #include "pledge.h"
      6 #endif
      7 
      8 /* Use CLOCK_REALTIME if CLOCK_MONOTONIC is not available */
      9 #ifndef CLOCK_MONOTONIC
     10 #define CLOCK_MONOTONIC CLOCK_REALTIME
     11 #endif
     12 
     13 #ifndef timespecsub
     14 #define	timespecsub(tsp, usp, vsp)					\
     15 	do {								\
     16 		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
     17 		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
     18 		if ((vsp)->tv_nsec < 0) {				\
     19 			(vsp)->tv_sec--;				\
     20 			(vsp)->tv_nsec += 1000000000L;			\
     21 		}							\
     22 	} while (0)
     23 #endif
     24 
     25 #endif /* COMPAT_H */