summaryrefslogtreecommitdiff
path: root/sysdeps/unix/clock_gettime.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2019-02-01 12:19:42 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2019-02-01 12:24:52 +0000
commitb06f4c0094d3c68be39ada0ed26ae99d51f48013 (patch)
treeb9520cb4d8a61e91fade8da9a419ec0b61cfded3 /sysdeps/unix/clock_gettime.c
parent83d1cc42d8e6b18a4b6ba53addfdae98c694ea36 (diff)
downloadglibc-b06f4c0094d3c68be39ada0ed26ae99d51f48013.tar.gz
Cleanup clock_*time includes
Clock_gettime, settime and getres implementations are unncessarily complex due to using defines and C file inclusion. Simplify the code by replacing the redundant defines and removing the inclusion, making it much easier to understand. No functional changes. * sysdeps/posix/clock_getres.c (__clock_getres): Cleanup. * sysdeps/unix/clock_gettime.c (__clock_gettime): Cleanup. * sysdeps/unix/clock_settime.c (__clock_settime): Cleanup. * sysdeps/unix/sysv/linux/clock_getres.c (__clock_getres): Cleanup. * sysdeps/unix/sysv/linux/clock_gettime.c (__clock_gettime): Cleanup. * sysdeps/unix/sysv/linux/clock_settime.c (__clock_settime): Cleanup.
Diffstat (limited to 'sysdeps/unix/clock_gettime.c')
-rw-r--r--sysdeps/unix/clock_gettime.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 138991d1bc..33a1f3335c 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -95,11 +95,6 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
switch (clock_id)
{
-#ifdef SYSDEP_GETTIME
- SYSDEP_GETTIME;
-#endif
-
-#ifndef HANDLED_REALTIME
case CLOCK_REALTIME:
{
struct timeval tv;
@@ -108,12 +103,8 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
TIMEVAL_TO_TIMESPEC (&tv, tp);
}
break;
-#endif
default:
-#ifdef SYSDEP_GETTIME_CPU
- SYSDEP_GETTIME_CPU (clock_id, tp);
-#endif
#if HP_TIMING_AVAIL
if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))
== CLOCK_THREAD_CPUTIME_ID)
@@ -123,7 +114,7 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
__set_errno (EINVAL);
break;
-#if HP_TIMING_AVAIL && !defined HANDLED_CPUTIME
+#if HP_TIMING_AVAIL
case CLOCK_PROCESS_CPUTIME_ID:
retval = hp_timing_gettime (clock_id, tp);
break;