summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/clockgettime.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src/clockgettime.c')
-rw-r--r--cpukit/posix/src/clockgettime.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpukit/posix/src/clockgettime.c b/cpukit/posix/src/clockgettime.c
index 2838ba657e..83a35d769a 100644
--- a/cpukit/posix/src/clockgettime.c
+++ b/cpukit/posix/src/clockgettime.c
@@ -37,19 +37,21 @@ int clock_gettime(
rtems_set_errno_and_return_minus_one( EINVAL );
if ( clock_id == CLOCK_REALTIME ) {
- _TOD_Get(tp);
+ _TOD_Get_as_timespec(tp);
return 0;
}
#ifdef CLOCK_MONOTONIC
if ( clock_id == CLOCK_MONOTONIC ) {
- _TOD_Get_uptime_as_timespec( tp );
+ _TOD_Get_zero_based_uptime_as_timespec( tp );
+ --tp->tv_sec;
return 0;
}
#endif
#ifdef _POSIX_CPUTIME
if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) {
- _TOD_Get_uptime_as_timespec( tp );
+ _TOD_Get_zero_based_uptime_as_timespec( tp );
+ --tp->tv_sec;
return 0;
}
#endif