about summary refs log tree commit diff
path: root/sysdeps/unix/clock_settime.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-03 04:57:09 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-03 04:57:09 +0000
commitad0e8eb0a565a44fe9616354d4e7556c3df9ae76 (patch)
treec74ddbeeded7e73a8ec30de6a3387bea066791af /sysdeps/unix/clock_settime.c
parent1e543c0cc620324b04da6891b9b7848da8704411 (diff)
downloadglibc-ad0e8eb0a565a44fe9616354d4e7556c3df9ae76.tar.gz
glibc-ad0e8eb0a565a44fe9616354d4e7556c3df9ae76.tar.xz
glibc-ad0e8eb0a565a44fe9616354d4e7556c3df9ae76.zip
Update.
2003-03-02  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
	_POSIX_MONOTONIC_CLOCK.
	* linuxthreads/sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
Diffstat (limited to 'sysdeps/unix/clock_settime.c')
-rw-r--r--sysdeps/unix/clock_settime.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sysdeps/unix/clock_settime.c b/sysdeps/unix/clock_settime.c
index 407e759137..a6c7af19ec 100644
--- a/sysdeps/unix/clock_settime.c
+++ b/sysdeps/unix/clock_settime.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
@@ -52,11 +52,22 @@ clock_settime (clockid_t clock_id, const struct timespec *tp)
 
   switch (clock_id)
     {
-    case CLOCK_REALTIME:
-      TIMESPEC_TO_TIMEVAL (&tv, tp);
+#define HANDLE_REALTIME \
+      do {								      \
+	TIMESPEC_TO_TIMEVAL (&tv, tp);					      \
+									      \
+	retval = settimeofday (&tv, NULL);				      \
+	while (0)
+
+#ifdef SYSDEP_GETTIME
+      SYSDEP_GETTIME;
+#endif
 
-      retval = settimeofday (&tv, NULL);
+#ifndef HANDLED_REALTIME
+    case CLOCK_REALTIME:
+      HANDLE_REALTIME;
       break;
+#endif
 
 #if HP_TIMING_AVAIL
     case CLOCK_PROCESS_CPUTIME_ID: