about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-08-13 00:46:30 +0000
committerUlrich Drepper <drepper@redhat.com>2007-08-13 00:46:30 +0000
commit4eb375fea3aac45e04a97885fc1b53c33ad7c837 (patch)
treedeae9b1ad801733f929c86b0f87ef0c984b5e350 /sysdeps/unix
parent3c87d79db7ae1f65294d088be7709140780b652c (diff)
downloadglibc-4eb375fea3aac45e04a97885fc1b53c33ad7c837.tar.gz
glibc-4eb375fea3aac45e04a97885fc1b53c33ad7c837.tar.xz
glibc-4eb375fea3aac45e04a97885fc1b53c33ad7c837.zip
* sysdeps/unix/sysv/linux/clock_gettime.c (maybe_syscall_gettime_cpu):
	Build fix for systems which might lack POSIX timer support.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/clock_gettime.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
index 5afe20feb5..cd536a0fc0 100644
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,5 @@
 /* clock_gettime -- Get current time from a POSIX clockid_t.  Linux version.
-   Copyright (C) 2003,2004,2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 2003,2004,2005,2006,2007 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
@@ -133,11 +133,19 @@ maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
 	{
 	  if (e == EINVAL)
 	    {
+# ifdef HAVE_CLOCK_GETRES_VSYSCALL
 	      /* Check whether the kernel supports CPU clocks at all.
 		 If not, record it for the future.  */
 	      r = INTERNAL_VSYSCALL (clock_getres, err, 2,
+				     MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
+				     NULL);
+# else
+	      /* Check whether the kernel supports CPU clocks at all.
+		 If not, record it for the future.  */
+	      r = INTERNAL_SYSCALL (clock_getres, err, 2,
 				    MAKE_PROCESS_CPUCLOCK (0, CPUCLOCK_SCHED),
 				    NULL);
+# endif
 	      if (INTERNAL_SYSCALL_ERROR_P (r, err))
 		__libc_missing_posix_cpu_timers = 1;
 	    }