summaryrefslogtreecommitdiff
path: root/defines.h
diff options
context:
space:
mode:
authordjm <djm>2003-01-24 00:50:32 +0000
committerdjm <djm>2003-01-24 00:50:32 +0000
commite3de28a536d4364fd7191fcb8b3da5cc45ee0141 (patch)
treee4df639dc219f43cfd8c62c6f28f1ad95cccda39 /defines.h
parent370c570c70de84388d8d1252aebc870c6445755e (diff)
downloadopenssh-e3de28a536d4364fd7191fcb8b3da5cc45ee0141.tar.gz
- (djm) Add TIMEVAL_TO_TIMESPEC macros
Diffstat (limited to 'defines.h')
-rw-r--r--defines.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/defines.h b/defines.h
index ab19a077..73fbe077 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