about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2015-03-04 15:14:56 -0800
committerRoland McGrath <roland@hack.frob.com>2015-03-04 15:14:56 -0800
commit2cfe32bc05b11b0dc633cd04f48f47734faf2399 (patch)
tree34b736b8344a6ceec8eeae0773d288ffa1b78c92
parente27176eea8aa74400204be4d3400e9723169fcaf (diff)
downloadglibc-2cfe32bc05b11b0dc633cd04f48f47734faf2399.tar.gz
glibc-2cfe32bc05b11b0dc633cd04f48f47734faf2399.tar.xz
glibc-2cfe32bc05b11b0dc633cd04f48f47734faf2399.zip
Conditionalize some test code for SIGRTMIN, SA_SIGINFO.
-rw-r--r--ChangeLog9
-rw-r--r--nptl/tst-cancel4.c4
-rw-r--r--nptl/tst-signal3.c20
-rw-r--r--nptl/tst-signal6.c10
-rw-r--r--rt/tst-mqueue5.c2
-rw-r--r--rt/tst-timer4.c7
6 files changed, 41 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 52e46c4450..10cdc67d21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2015-03-04  Roland McGrath  <roland@hack.frob.com>
 
+	* nptl/tst-cancel4.c (tf_sigpause) [!SIGCANCEL]: Call pause instead of
+	__xpg_sigpause.
+	* nptl/tst-signal3.c: Conditionalize body on [SIGRTMIN].
+	* nptl/tst-signal6.c: Likewise.
+	* rt/tst-mqueue5.c: Conditionalize body on [SIGRTMIN && SA_SIGINFO].
+	* rt/tst-timer4.c: Conditionalize body on [SA_SIGINFO].
+
+2015-03-04  Roland McGrath  <roland@hack.frob.com>
+
 	* configure.ac (libc_cv_cxx_link_ok): New check.
 	Reset CXX to empty if it fails to link.
 	* configure: Regenerated.
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index 4916746614..e50afd7900 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -781,9 +781,13 @@ tf_sigpause (void *arg)
 
   pthread_cleanup_push (cl, NULL);
 
+#ifdef SIGCANCEL
   /* Just for fun block the cancellation signal.  We need to use
      __xpg_sigpause since otherwise we will get the BSD version.  */
   __xpg_sigpause (SIGCANCEL);
+#else
+  pause ();
+#endif
 
   pthread_cleanup_pop (0);
 
diff --git a/nptl/tst-signal3.c b/nptl/tst-signal3.c
index c17933e243..90b2e71b28 100644
--- a/nptl/tst-signal3.c
+++ b/nptl/tst-signal3.c
@@ -25,13 +25,14 @@
 #include <unistd.h>
 
 
-/* Number of different signalss to use.  Also is the number of
-   threads.  */
-#define N 10
+#ifdef SIGRTMIN
+
+/* Number of different signals to use.  Also is the number of threads.  */
+# define N 10
 /* Maximum number of threads in flight at any one time.  */
-#define INFLIGHT 5
+# define INFLIGHT 5
 /* Number of signals sent in total.  */
-#define ROUNDS 10000
+# define ROUNDS 10000
 
 
 static int received[N][N];
@@ -255,6 +256,11 @@ do_test (void)
   return result;
 }
 
-#define TIMEOUT 10
-#define TEST_FUNCTION do_test ()
+# define TIMEOUT 10
+# define TEST_FUNCTION do_test ()
+
+#else
+# define TEST_FUNCTION 0
+#endif
+
 #include "../test-skeleton.c"
diff --git a/nptl/tst-signal6.c b/nptl/tst-signal6.c
index e2a56ef427..b98947a9e7 100644
--- a/nptl/tst-signal6.c
+++ b/nptl/tst-signal6.c
@@ -24,7 +24,9 @@
 #include <unistd.h>
 
 
-#define N 2
+#ifdef SIGRTMIN
+
+# define N 2
 static pthread_barrier_t bar;
 static struct
 {
@@ -187,5 +189,9 @@ do_test (void)
   return 0;
 }
 
-#define TEST_FUNCTION do_test ()
+# define TEST_FUNCTION do_test ()
+
+#else
+# define TEST_FUNCTION 0
+#endif
 #include "../test-skeleton.c"
diff --git a/rt/tst-mqueue5.c b/rt/tst-mqueue5.c
index 8714dad3f4..6000f72878 100644
--- a/rt/tst-mqueue5.c
+++ b/rt/tst-mqueue5.c
@@ -35,7 +35,7 @@
 
 #define TIMEOUT 3
 
-#if _POSIX_THREADS
+#if _POSIX_THREADS && defined SIGRTMIN && defined SA_SIGINFO
 # include <pthread.h>
 
 volatile int rtmin_cnt;
diff --git a/rt/tst-timer4.c b/rt/tst-timer4.c
index 4a06496cb6..f694e300c5 100644
--- a/rt/tst-timer4.c
+++ b/rt/tst-timer4.c
@@ -24,7 +24,7 @@
 #include <time.h>
 #include <unistd.h>
 #include <stdint.h>
-#if _POSIX_THREADS
+#if _POSIX_THREADS && defined SA_SIGINFO
 # include <pthread.h>
 
 # ifndef TEST_CLOCK
@@ -641,6 +641,11 @@ do_test (void)
     }
   return result;
 }
+
+#elif defined TEST_CLOCK_MISSING
+/* This just ensures that any functions called in TEST_CLOCK_MISSING
+   are not diagnosed as unused.  */
+# define TEST_FUNCTION (TEST_CLOCK_MISSING (TEST_CLOCK), 0)
 #else
 # define TEST_FUNCTION 0
 #endif