about summary refs log tree commit diff
path: root/nptl/sysdeps/pthread
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-03 07:29:24 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-03 07:29:24 +0000
commit5324b81cb30633139c94ccd3b11817d4298fab32 (patch)
tree07a2e7053a9890ed09461def0c3609b796bc467c /nptl/sysdeps/pthread
parentf5d31593775dc42b5e7e8db6de8502332659e7f8 (diff)
downloadglibc-5324b81cb30633139c94ccd3b11817d4298fab32.tar.gz
glibc-5324b81cb30633139c94ccd3b11817d4298fab32.tar.xz
glibc-5324b81cb30633139c94ccd3b11817d4298fab32.zip
(timer_create): Return correct error for CPU clocks.
Diffstat (limited to 'nptl/sysdeps/pthread')
-rw-r--r--nptl/sysdeps/pthread/timer_create.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/nptl/sysdeps/pthread/timer_create.c b/nptl/sysdeps/pthread/timer_create.c
index b34f70e8c1..795f94c7d2 100644
--- a/nptl/sysdeps/pthread/timer_create.c
+++ b/nptl/sysdeps/pthread/timer_create.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
 
@@ -37,15 +37,23 @@ timer_create (clock_id, evp, timerid)
   struct timer_node *newtimer = NULL;
   struct thread_node *thread = NULL;
 
-  if (clock_id != CLOCK_REALTIME
+  if (0
 #ifdef _POSIX_CPUTIME
-      && clock_id != CLOCK_PROCESS_CPUTIME_ID
+      || clock_id == CLOCK_PROCESS_CPUTIME_ID
 #endif
 #ifdef _POSIX_THREAD_CPUTIME
-      && clock_id != CLOCK_THREAD_CPUTIME_ID
+      || clock_id == CLOCK_THREAD_CPUTIME_ID
 #endif
       )
     {
+      /* We don't allow timers for CPU clocks.  At least not in the
+	 moment.  */
+      __set_errno (ENOTSUP);
+      return -1;
+    }
+
+  if (clock_id != CLOCK_REALTIME)
+    {
       __set_errno (EINVAL);
       return -1;
     }