projects
/
crypto.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f240b4
)
Use clock_gettime if it is available.
author
Pekka Riikonen
<priikone@silcnet.org>
Sat, 1 Sep 2007 09:27:48 +0000
(09:27 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Sat, 1 Sep 2007 09:27:48 +0000
(09:27 +0000)
lib/silcutil/unix/silcunixutil.c
patch
|
blob
|
history
diff --git
a/lib/silcutil/unix/silcunixutil.c
b/lib/silcutil/unix/silcunixutil.c
index 4b37ea5e769c65e59dd12656130e675010ad295d..50e01d07b92282fbb31db4980053741b6cc2ee9b 100644
(file)
--- a/
lib/silcutil/unix/silcunixutil.c
+++ b/
lib/silcutil/unix/silcunixutil.c
@@
-69,7
+69,15
@@
char *silc_get_real_name()
int silc_gettimeofday(struct timeval *p)
{
+#if defined(HAVE_CLOCK_GETTIME)
+ struct timespec tp;
+ clock_gettime(CLOCK_REALTIME, &tp);
+ p->tv_sec = tp.tv_sec;
+ p->tv_usec = tp.tv_nsec / 1000;
+ return 0;
+#else
return gettimeofday(p, NULL);
+#endif /* HAVE_CLOCK_GETTIME */
}
int silc_file_set_nonblock(int fd)