-/* $OpenBSD: time.h,v 1.3 1996/05/02 13:14:04 deraadt Exp $ */
+/* $OpenBSD: time.h,v 1.4 1997/04/20 20:47:34 tholo Exp $ */
/* $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ */
/*
} \
} while (0)
+/* Operations on timespecs. */
+#define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0
+#define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec)
+#define timespeccmp(tsp, usp, cmp) \
+ (((tsp)->tv_sec == (usp)->tv_sec) ? \
+ ((tsp)->tv_nsec cmp (usp)->tv_nsec) : \
+ ((tsp)->tv_sec cmp (usp)->tv_sec))
+#define timespecadd(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 >= 1000000000L) { \
+ (vsp)->tv_sec++; \
+ (vsp)->tv_nsec -= 1000000000L; \
+ } \
+ } while (0)
+#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)
+
/*
* Names of the interval timers, and structure
* defining a timer setting.
int profhz; /* profiling clock frequency */
};
+#define CLOCK_REALTIME 0
+#define CLOCK_VIRTUAL 1
+#define CLOCK_PROF 2
+
+#define TIMER_RELTIME 0x0 /* relative timer */
+#define TIMER_ABSTIME 0x1 /* absolute timer */
+
#ifdef _KERNEL
int itimerfix __P((struct timeval *tv));
int itimerdecr __P((struct itimerval *itp, int usec));
-/* $OpenBSD: types.h,v 1.9 1996/05/28 12:16:28 deraadt Exp $ */
-/* $NetBSD: types.h,v 1.26 1996/04/09 20:55:47 cgd Exp $ */
+/* $OpenBSD: types.h,v 1.10 1997/04/20 20:47:33 tholo Exp $ */
+/* $NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $ */
/*-
* Copyright (c) 1982, 1986, 1991, 1993
#undef _BSD_TIME_T_
#endif
+#ifdef _BSD_CLOCKID_T_
+typedef _BSD_CLOCKID_T_ clockid_t;
+#undef _BSD_CLOCKID_T_
+#endif
+
+#ifdef _BSD_TIMER_T_
+typedef _BSD_TIMER_T_ timer_t;
+#undef _BSD_TIMER_T_
+#endif
+
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#define NBBY 8 /* number of bits in a byte */