aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/clock_gettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/clock_gettime.c')
-rw-r--r--sysdeps/unix/clock_gettime.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 3a1717daf3..8f82ac848d 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -93,6 +93,7 @@ int
clock_gettime (clockid_t clock_id, struct timespec *tp)
{
int retval = -1;
+ struct timeval tv;
switch (clock_id)
{
@@ -102,7 +103,9 @@ clock_gettime (clockid_t clock_id, struct timespec *tp)
#ifndef HANDLED_REALTIME
case CLOCK_REALTIME:
- HANDLE_REALTIME;
+ retval = gettimeofday (&tv, NULL);
+ if (retval == 0)
+ TIMEVAL_TO_TIMESPEC (&tv, tp);
break;
#endif