summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-01-24 11:50:32 +1100
committerDamien Miller <djm@mindrot.org>2003-01-24 11:50:32 +1100
commit3bc0c062abf4d7a41373694ae04363579e2345e4 (patch)
treea6f20936406764c21e17c1d4e4453552da198907
parent8e12147df54c5e490e847bbc0ede41ac0a17af9c (diff)
- (djm) Add TIMEVAL_TO_TIMESPEC macros
-rw-r--r--ChangeLog3
-rw-r--r--defines.h16
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0875c7026..70ce05524 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
14 - markus@cvs.openbsd.org 2003/01/23 14:06:15 14 - markus@cvs.openbsd.org 2003/01/23 14:06:15
15 [scp.1 scp.c] 15 [scp.1 scp.c]
16 scp -12; Sam Smith and others; ok provos@, deraadt@ 16 scp -12; Sam Smith and others; ok provos@, deraadt@
17 - (djm) Add TIMEVAL_TO_TIMESPEC macros
17 18
1820030123 1920030123
19 - (djm) OpenBSD CVS Sync 20 - (djm) OpenBSD CVS Sync
@@ -1073,4 +1074,4 @@
1073 save auth method before monitor_reset_key_state(); bugzilla bug #284; 1074 save auth method before monitor_reset_key_state(); bugzilla bug #284;
1074 ok provos@ 1075 ok provos@
1075 1076
1076$Id: ChangeLog,v 1.2586 2003/01/24 00:37:38 djm Exp $ 1077$Id: ChangeLog,v 1.2587 2003/01/24 00:50:32 djm Exp $
diff --git a/defines.h b/defines.h
index ab19a077c..73fbe077b 100644
--- a/defines.h
+++ b/defines.h
@@ -1,7 +1,7 @@
1#ifndef _DEFINES_H 1#ifndef _DEFINES_H
2#define _DEFINES_H 2#define _DEFINES_H
3 3
4/* $Id: defines.h,v 1.96 2002/09/26 00:38:48 tim Exp $ */ 4/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */
5 5
6 6
7/* Constants */ 7/* Constants */
@@ -370,6 +370,20 @@ struct winsize {
370 } while (0) 370 } while (0)
371#endif 371#endif
372 372
373#ifndef TIMEVAL_TO_TIMESPEC
374#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
375 (ts)->tv_sec = (tv)->tv_sec; \
376 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
377}
378#endif
379
380#ifndef TIMESPEC_TO_TIMEVAL
381#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
382 (tv)->tv_sec = (ts)->tv_sec; \
383 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
384}
385#endif
386
373#ifndef __P 387#ifndef __P
374# define __P(x) x 388# define __P(x) x
375#endif 389#endif