File: time.h

package info (click to toggle)
openbgpd 8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,176 kB
  • sloc: ansic: 51,348; sh: 11,743; yacc: 5,515; makefile: 327
file content (18 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Public domain
 * sys/time.h compatibility shim
 */

#include_next <sys/time.h>

#ifndef timespecsub
#define	timespecsub(tsp, usp, vsp)					\
	do {								\
		(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec;		\
		(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec;	\
		if ((vsp)->tv_nsec < 0) {				\
			(vsp)->tv_sec--;				\
			(vsp)->tv_nsec += 1000000000L;			\
		}							\
	} while (0)
#endif