projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid mempcpy in the regex code, as the string.h mempcpy stuff
[gnulib.git]
/
lib
/
gettime.c
diff --git
a/lib/gettime.c
b/lib/gettime.c
index
abef2c4
..
86bd325
100644
(file)
--- a/
lib/gettime.c
+++ b/
lib/gettime.c
@@
-1,6
+1,6
@@
/* gettime -- get the system clock
/* gettime -- get the system clock
- Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005, 2006
, 2007
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-22,6
+22,8
@@
#include "timespec.h"
#include "timespec.h"
+#include <sys/time.h>
+
/* Get the system time into *TS. */
void
/* Get the system time into *TS. */
void
@@
-36,23
+38,12
@@
gettime (struct timespec *ts)
return;
# endif
return;
# endif
-# if HAVE_GETTIMEOFDAY
{
struct timeval tv;
gettimeofday (&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
}
{
struct timeval tv;
gettimeofday (&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
}
-# else
-
-# ifndef OK_TO_USE_1S_CLOCK
-# error "Only 1-second nominal clock resolution found. Is that intended?" \
- "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
-# endif
- ts->tv_sec = time (NULL);
- ts->tv_nsec = 0;
-
-# endif
#endif
}
#endif
}