From ad0e8eb0a565a44fe9616354d4e7556c3df9ae76 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 3 Mar 2003 04:57:09 +0000 Subject: Update. 2003-03-02 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/posix_opt.h: Define _POSIX_MONOTONIC_CLOCK. * linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise. --- sysdeps/unix/clock_gettime.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'sysdeps/unix/clock_gettime.c') diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c index 5dc329e1c0..4c26a370e6 100644 --- a/sysdeps/unix/clock_gettime.c +++ b/sysdeps/unix/clock_gettime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -46,12 +46,23 @@ clock_gettime (clockid_t clock_id, struct timespec *tp) switch (clock_id) { +#define HANDLE_REALTIME \ + do { \ + retval = gettimeofday (&tv, NULL); \ + if (retval == 0) \ + /* Convert into `timespec'. */ \ + TIMEVAL_TO_TIMESPEC (&tv, tp); \ + } while (0) + +#ifdef SYSDEP_GETTIME + SYSDEP_GETTIME; +#endif + +#ifndef HANDLED_REALTIME case CLOCK_REALTIME: - retval = gettimeofday (&tv, NULL); - if (retval == 0) - /* Convert into `timespec'. */ - TIMEVAL_TO_TIMESPEC (&tv, tp); + HANDLE_REALTIME; break; +#endif #if HP_TIMING_AVAIL case CLOCK_PROCESS_CPUTIME_ID: -- cgit 1.4.1