- (djm) Add TIMEVAL_TO_TIMESPEC macros

This commit is contained in:
Damien Miller 2003-01-24 11:50:32 +11:00
parent 8e12147df5
commit 3bc0c062ab
2 changed files with 17 additions and 2 deletions

View File

@ -14,6 +14,7 @@
- markus@cvs.openbsd.org 2003/01/23 14:06:15
[scp.1 scp.c]
scp -12; Sam Smith and others; ok provos@, deraadt@
- (djm) Add TIMEVAL_TO_TIMESPEC macros
20030123
- (djm) OpenBSD CVS Sync
@ -1073,4 +1074,4 @@
save auth method before monitor_reset_key_state(); bugzilla bug #284;
ok provos@
$Id: ChangeLog,v 1.2586 2003/01/24 00:37:38 djm Exp $
$Id: ChangeLog,v 1.2587 2003/01/24 00:50:32 djm Exp $

View File

@ -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