+2004-10-04 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
+ and _POSIX_THREAD_CPUTIME to zero.
+ * sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
+ * tst-barrier2.c: Fix testing for POSIX feature.
+ * tst-clock1.c: Likewise.
+ * tst-clock2.c: Likewise.
+ * tst-cond11.c: Likewise.
+ * tst-cond4.c: Likewise.
+ * tst-cond6.c: Likewise.
+ * tst-flock2.c: Likewise.
+ * tst-mutex4.c: Likewise.
+ * tst-mutex9.c: Likewise.
+ * tst-rwlock12.c: Likewise.
+ * tst-rwlock4.c: Likewise.
+ * tst-signal1.c: Likewise.
+ * tst-spin2.c: Likewise.
+ * sysdeps/pthread/posix-timer.h: Likewise.
+ * sysdeps/pthread/timer_create.c: Likewise.
+ * sysdeps/pthread/timer_routines.c: Likewise.
+
2004-10-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
/* Definitions for POSIX timer implementation on top of NPTL.
- Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
/* A distinct thread is used for each clock type. */
extern struct thread_node __timer_signal_thread_rclk;
-#ifdef _POSIX_CPUTIME
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
extern struct thread_node __timer_signal_thread_pclk;
#endif
-#ifdef _POSIX_THREAD_CPUTIME
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
extern struct thread_node __timer_signal_thread_tclk;
#endif
struct thread_node *thread = NULL;
if (0
-#ifdef _POSIX_CPUTIME
+#ifdef CLOCK_PROCESS_CPUTIME_ID
|| clock_id == CLOCK_PROCESS_CPUTIME_ID
#endif
-#ifdef _POSIX_THREAD_CPUTIME
+#ifdef CLOCK_THREAD_CPUTIME_ID
|| clock_id == CLOCK_THREAD_CPUTIME_ID
#endif
)
default:
thread = &__timer_signal_thread_rclk;
break;
-#ifdef _POSIX_CPUTIME
+#ifdef CLOCK_PROCESS_CPUTIME_ID
case CLOCK_PROCESS_CPUTIME_ID:
thread = &__timer_signal_thread_pclk;
break;
#endif
-#ifdef _POSIX_THREAD_CPUTIME
+#ifdef CLOCK_THREAD_CPUTIME_ID
case CLOCK_THREAD_CPUTIME_ID:
thread = &__timer_signal_thread_tclk;
break;
/* Node for the thread used to deliver signals. */
struct thread_node __timer_signal_thread_rclk;
-#ifdef _POSIX_CPUTIME
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
struct thread_node __timer_signal_thread_pclk;
#endif
-#ifdef _POSIX_THREAD_CPUTIME
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
struct thread_node __timer_signal_thread_tclk;
#endif
list_append (&thread_free_list, &thread_array[i].links);
thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME);
-#ifdef _POSIX_CPUTIME
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID);
#endif
-#ifdef _POSIX_THREAD_CPUTIME
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID);
#endif
}
/* How did the signal thread get killed? */
assert (thread != &__timer_signal_thread_rclk);
-#ifdef _POSIX_CPUTIME
+#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
assert (thread != &__timer_signal_thread_pclk);
#endif
-#ifdef _POSIX_THREAD_CPUTIME
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
assert (thread != &__timer_signal_thread_tclk);
#endif
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
/* CPU-time clocks supported. */
-#define _POSIX_CPUTIME 200112L
+#define _POSIX_CPUTIME 0
/* We support the clock also in threads. */
-#define _POSIX_THREAD_CPUTIME 200112L
+#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
/* CPU-time clocks supported. */
-#define _POSIX_CPUTIME 200112L
+#define _POSIX_CPUTIME 0
/* We support the clock also in threads. */
-#define _POSIX_THREAD_CPUTIME 200112L
+#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-barrier2.XXXXXX";
char data[ps];
WEXITSTATUS (status) + serials, N);
return 1;
}
-#endif
return 0;
}
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
int
do_test (void)
{
-#if _POSIX_THREAD_CPUTIME
+#ifdef _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
clockid_t cl;
/* This is really only a linking-test here. */
int e = pthread_getcpuclockid (pthread_self (), &cl);
if (e != 0)
{
-# if _POSIX_THREAD_CPUTIME < 0
+# if _POSIX_THREAD_CPUTIME == 0
if (sysconf (_SC_THREAD_CPUTIME) >= 0)
# endif
{
#include <unistd.h>
-#if _POSIX_THREAD_CPUTIME
+#ifdef _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
static pthread_barrier_t b2;
static pthread_barrier_t bN;
int
do_test (void)
{
-#if _POSIX_THREAD_CPUTIME
+#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
# define N 10
if (pthread_barrier_init (&b2, NULL, 2) != 0
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
#include <unistd.h>
-#if _POSIX_CLOCK_SELECTION
+#ifdef _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0
static int
run_test (clockid_t cl)
{
static int
do_test (void)
{
-#if ! _POSIX_CLOCK_SELECTION
+#if !defined _POSIX_CLOCK_SELECTION || _POSIX_CLOCK_SELECTION == -1
puts ("_POSIX_CLOCK_SELECTION not supported, test skipped");
return 0;
int res = run_test (CLOCK_REALTIME);
-# if defined _POSIX_MONOTONIC_CLOCK
+# if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
# if _POSIX_MONOTONIC_CLOCK == 0
int e = sysconf (_SC_MONOTONIC_CLOCK);
if (e < 0)
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-cond4.XXXXXX";
char data[ps];
}
return result;
-#endif
}
#define TEST_FUNCTION do_test ()
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-cond6.XXXXXX";
char data[ps];
}
return result;
-#endif
}
#define TEST_FUNCTION do_test ()
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
char tmp[] = "/tmp/tst-flock2-XXXXXX";
fd = mkstemp (tmp);
}
return status;
-#endif
}
#define TEST_FUNCTION do_test ()
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-mutex4.XXXXXX";
char data[ps];
}
return 0;
-#endif
}
#define TIMEOUT 4
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-mutex9.XXXXXX";
char data[ps];
}
return 0;
-#endif
}
#define TIMEOUT 3
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-rwlock12.XXXXXX";
char data[ps];
}
return status;
-#endif
}
#define TEST_FUNCTION do_test ()
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-rwlock4.XXXXXX";
char data[ps];
}
return 0;
-#endif
}
#define TEST_FUNCTION do_test ()
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
- return 0;
-
-#else
-
char tmp[] = "/tmp/tst-signal1-XXXXXX";
int fd = mkstemp (tmp);
}
return 0;
-#endif
}
#define TEST_FUNCTION do_test ()
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
static int
do_test (void)
{
-#if ! _POSIX_THREAD_PROCESS_SHARED
-
- puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
-
-#else
-
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-spin2.XXXXXX";
char data[ps];
puts ("parent done");
}
-#endif
return 0;
}