BIND 10 trac1526, updated. dd6f8bdc0f67c83aea2f91cd56c21a4b822d735b [1526] perfdhcp compilation fix (part 2, perfdhcp.c)
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 22 16:31:20 UTC 2011
The branch, trac1526 has been updated
via dd6f8bdc0f67c83aea2f91cd56c21a4b822d735b (commit)
from d12104290629bd4f3c2e9edbc1b4139d337afeeb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit dd6f8bdc0f67c83aea2f91cd56c21a4b822d735b
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Thu Dec 22 17:26:23 2011 +0100
[1526] perfdhcp compilation fix (part 2, perfdhcp.c)
-----------------------------------------------------------------------
Summary of changes:
tests/tools/perfdhcp/perfdhcp.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/perfdhcp.c b/tests/tools/perfdhcp/perfdhcp.c
index e43b37f..b9795f6 100644
--- a/tests/tools/perfdhcp/perfdhcp.c
+++ b/tests/tools/perfdhcp/perfdhcp.c
@@ -362,6 +362,36 @@ size_t random_request6;
size_t serverid_request6;
size_t reqaddr_request6;
+
+// use definition of CLOCK_REALTIME (or lack of thereof) as an indicator
+// if the code is being compiled or Linux (or somewhere else)
+// Perhaps this should be based on OS_LINUX define?
+
+#if !defined (CLOCK_REALTIME)
+#define CLOCK_REALTIME 0
+
+/// @brief clock_gettime implementation for non-Linux systems
+///
+/// This implementation lacks nanosecond resolution. It is intended
+/// to be used on non-Linux systems that does not provide clock_gettime
+/// implementation.
+///
+/// @param clockid ignored (kept for Linux prototype compatibility)
+/// @param tp timespec structure
+///
+/// @return always zero (kept for compatibility reasons)
+int clock_gettime(int clockid, struct timespec *tp) {
+
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ tp->tv_sec = tv.tv_sec;
+ tp->tv_nsec = tv.tv_usec*1000;
+
+ return (0);
+}
+
+#endif
+
/*
* initialize data structures handling exchanges
*/
More information about the bind10-changes
mailing list