From 3bc0c062abf4d7a41373694ae04363579e2345e4 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 24 Jan 2003 11:50:32 +1100 Subject: - (djm) Add TIMEVAL_TO_TIMESPEC macros --- defines.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'defines.h') diff --git a/defines.h b/defines.h index ab19a077c..73fbe077b 100644 --- a/defines.h +++ b/defines.h @@ -1,7 +1,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.96 2002/09/26 00:38:48 tim Exp $ */ +/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */ /* Constants */ @@ -370,6 +370,20 @@ struct winsize { } while (0) #endif +#ifndef TIMEVAL_TO_TIMESPEC +#define TIMEVAL_TO_TIMESPEC(tv, ts) { \ + (ts)->tv_sec = (tv)->tv_sec; \ + (ts)->tv_nsec = (tv)->tv_usec * 1000; \ +} +#endif + +#ifndef TIMESPEC_TO_TIMEVAL +#define TIMESPEC_TO_TIMEVAL(tv, ts) { \ + (tv)->tv_sec = (ts)->tv_sec; \ + (tv)->tv_usec = (ts)->tv_nsec / 1000; \ +} +#endif + #ifndef __P # define __P(x) x #endif -- cgit v1.2.3