[PATCH] Fix ppc64 NPTL compilation
Jakub Jelinek
jakub@redhat.com
Tue Oct 5 15:33:00 GMT 2004
Hi!
__timer_signal_thread_pclk declaration is now guarded with
#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
but #ifdef CLOCK_PROCESS_CPUTIME_ID is true on wider subset
of architectures.
I think
#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
implies
#ifdef CLOCK_PROCESS_CPUTIME_ID
so the following patch should DTRT.
2004-10-05 Jakub Jelinek <jakub@redhat.com>
* sysdeps/pthread/timer_create.c (timer_create): Use
defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0 instead of
defined CLOCK_PROCESS_CPUTIME_ID #ifs and similarly for
THREAD_CPUTIME.
--- libc/nptl/sysdeps/pthread/timer_create.c.jj 2004-10-05 09:04:47.000000000 +0200
+++ libc/nptl/sysdeps/pthread/timer_create.c 2004-10-05 17:04:53.536976849 +0200
@@ -38,10 +38,10 @@ timer_create (clock_id, evp, timerid)
struct thread_node *thread = NULL;
if (0
-#ifdef CLOCK_PROCESS_CPUTIME_ID
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
|| clock_id == CLOCK_PROCESS_CPUTIME_ID
#endif
-#ifdef CLOCK_THREAD_CPUTIME_ID
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
|| clock_id == CLOCK_THREAD_CPUTIME_ID
#endif
)
@@ -100,12 +100,12 @@ timer_create (clock_id, evp, timerid)
default:
thread = &__timer_signal_thread_rclk;
break;
-#ifdef CLOCK_PROCESS_CPUTIME_ID
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
case CLOCK_PROCESS_CPUTIME_ID:
thread = &__timer_signal_thread_pclk;
break;
#endif
-#ifdef CLOCK_THREAD_CPUTIME_ID
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
case CLOCK_THREAD_CPUTIME_ID:
thread = &__timer_signal_thread_tclk;
break;
Jakub
More information about the Libc-hacker
mailing list