summaryrefslogtreecommitdiff
path: root/test/nptl
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-06 17:48:49 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-06 17:48:49 +0100
commit2ce94b3cb4db55c981ee6f2cbe1d3e790e89a2b7 (patch)
tree4b86ffd597b7c629cf3e65a3e3c2a918acd9a409 /test/nptl
parent094224b6b6a11ae8cb5b7d47e62e25235704fe0b (diff)
allow to compile and run on musl based systems
This is a first shot, more improvements required to allow to run more tests.
Diffstat (limited to 'test/nptl')
-rw-r--r--test/nptl/tst-atfork1.c2
-rw-r--r--test/nptl/tst-atfork2.c2
-rw-r--r--test/nptl/tst-attr3.c11
-rw-r--r--test/nptl/tst-basic4.c2
-rw-r--r--test/nptl/tst-basic7.c4
-rw-r--r--test/nptl/tst-cancel16.c1
-rw-r--r--test/nptl/tst-cancel18.c2
-rw-r--r--test/nptl/tst-cancel22.c1
-rw-r--r--test/nptl/tst-cancel4.c5
-rw-r--r--test/nptl/tst-cleanup4.c7
-rw-r--r--test/nptl/tst-cleanup4aux.c2
-rw-r--r--test/nptl/tst-clock2.c1
-rw-r--r--test/nptl/tst-clock_nanosleep.c2
-rw-r--r--test/nptl/tst-cond14.c8
-rw-r--r--test/nptl/tst-cond15.c8
-rw-r--r--test/nptl/tst-cond22.c8
-rw-r--r--test/nptl/tst-cond8.c7
-rw-r--r--test/nptl/tst-cond9.c7
-rw-r--r--test/nptl/tst-exec2.c2
-rw-r--r--test/nptl/tst-exec3.c1
-rw-r--r--test/nptl/tst-flock2.c3
-rw-r--r--test/nptl/tst-fork1.c1
-rw-r--r--test/nptl/tst-fork2.c2
-rw-r--r--test/nptl/tst-fork3.c1
-rw-r--r--test/nptl/tst-getpid3.c2
-rw-r--r--test/nptl/tst-initializers1.c6
-rw-r--r--test/nptl/tst-kill6.c2
-rw-r--r--test/nptl/tst-mqueue1.c1
-rw-r--r--test/nptl/tst-mqueue3.c2
-rw-r--r--test/nptl/tst-mqueue5.c1
-rw-r--r--test/nptl/tst-mqueue6.c1
-rw-r--r--test/nptl/tst-mqueue8.c3
-rw-r--r--test/nptl/tst-mqueue9.c1
-rw-r--r--test/nptl/tst-mutex5.c4
-rw-r--r--test/nptl/tst-mutex7.c7
-rw-r--r--test/nptl/tst-mutex9.c3
-rw-r--r--test/nptl/tst-rwlock12.c2
-rw-r--r--test/nptl/tst-rwlock6.c8
-rw-r--r--test/nptl/tst-rwlock7.c8
-rw-r--r--test/nptl/tst-rwlock8.c8
-rw-r--r--test/nptl/tst-rwlock9.c8
-rw-r--r--test/nptl/tst-sem1.c2
-rw-r--r--test/nptl/tst-sem10.c1
-rw-r--r--test/nptl/tst-sem2.c1
-rw-r--r--test/nptl/tst-sem3.c1
-rw-r--r--test/nptl/tst-sem4.c6
-rw-r--r--test/nptl/tst-sem5.c2
-rw-r--r--test/nptl/tst-sem7.c4
-rw-r--r--test/nptl/tst-sem8.c4
-rw-r--r--test/nptl/tst-sem9.c4
-rw-r--r--test/nptl/tst-signal1.c1
-rw-r--r--test/nptl/tst-signal2.c1
-rw-r--r--test/nptl/tst-signal3.c1
-rw-r--r--test/nptl/tst-timer4.c2
-rw-r--r--test/nptl/tst-tls2.c1
-rw-r--r--test/nptl/tst-tls3.c1
-rw-r--r--test/nptl/tst-tsd6.c1
-rw-r--r--test/nptl/tst-vfork1x.c1
-rw-r--r--test/nptl/tst-vfork2x.c1
59 files changed, 157 insertions, 35 deletions
diff --git a/test/nptl/tst-atfork1.c b/test/nptl/tst-atfork1.c
index 1298937..483f7a6 100644
--- a/test/nptl/tst-atfork1.c
+++ b/test/nptl/tst-atfork1.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static int val;
diff --git a/test/nptl/tst-atfork2.c b/test/nptl/tst-atfork2.c
index 594f56e..b9808ac 100644
--- a/test/nptl/tst-atfork2.c
+++ b/test/nptl/tst-atfork2.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
/* Must be exported. */
int val;
diff --git a/test/nptl/tst-attr3.c b/test/nptl/tst-attr3.c
index 5ccf9ab..27d89f2 100644
--- a/test/nptl/tst-attr3.c
+++ b/test/nptl/tst-attr3.c
@@ -18,12 +18,17 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
#include <error.h>
+#else
+#include "../error.h"
+#endif
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "../test-skeleton.h"
static void *
tf (void *arg)
@@ -164,6 +169,7 @@ tf (void *arg)
}
}
+#if defined(__GLIBC__) || defined(__UCLIBC__)
cpu_set_t c1, c2;
err = pthread_getaffinity_np (pthread_self (), sizeof (c1), &c1);
if (err == 0)
@@ -180,6 +186,7 @@ tf (void *arg)
result = tf;
}
}
+#endif
err = pthread_attr_destroy (&a);
if (err)
@@ -216,12 +223,14 @@ do_test (void)
result = 1;
}
+#if defined(__GLIBC__) || defined(__UCLIBC__)
err = pthread_attr_getaffinity_np (&a, sizeof (c1), &c1);
if (err && err != ENOSYS)
{
error (0, err, "pthread_attr_getaffinity_np failed");
result = 1;
}
+#endif
err = pthread_attr_destroy (&a);
if (err)
@@ -310,6 +319,7 @@ do_test (void)
result = 1;
}
+#if defined(__GLIBC__) || defined(__UCLIBC__)
err = pthread_getaffinity_np (pthread_self (), sizeof (c1), &c1);
if (err == 0)
{
@@ -325,6 +335,7 @@ do_test (void)
result = 1;
}
}
+#endif
err = pthread_attr_destroy (&a);
if (err)
diff --git a/test/nptl/tst-basic4.c b/test/nptl/tst-basic4.c
index b69ca20..f7bdf1d 100644
--- a/test/nptl/tst-basic4.c
+++ b/test/nptl/tst-basic4.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static void
final_test (void)
diff --git a/test/nptl/tst-basic7.c b/test/nptl/tst-basic7.c
index 15b6187..7a461a4 100644
--- a/test/nptl/tst-basic7.c
+++ b/test/nptl/tst-basic7.c
@@ -32,10 +32,10 @@ use_up_memory (void)
setrlimit (RLIMIT_AS, &rl);
char *c;
- int PAGESIZE = getpagesize ();
+ int pagesize = getpagesize ();
while (1)
{
- c = mmap (NULL, PAGESIZE, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
+ c = mmap (NULL, pagesize, PROT_NONE, MAP_ANON | MAP_PRIVATE, -1, 0);
if (c == MAP_FAILED)
break;
}
diff --git a/test/nptl/tst-cancel16.c b/test/nptl/tst-cancel16.c
index 6af657c..a1e3c5a 100644
--- a/test/nptl/tst-cancel16.c
+++ b/test/nptl/tst-cancel16.c
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
static pthread_barrier_t b2;
diff --git a/test/nptl/tst-cancel18.c b/test/nptl/tst-cancel18.c
index e653119..4fb4357 100644
--- a/test/nptl/tst-cancel18.c
+++ b/test/nptl/tst-cancel18.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
-
+#include "../test-skeleton.h"
static pthread_barrier_t b;
diff --git a/test/nptl/tst-cancel22.c b/test/nptl/tst-cancel22.c
index 8febbf0..e2c41f1 100644
--- a/test/nptl/tst-cancel22.c
+++ b/test/nptl/tst-cancel22.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "../test-skeleton.h"
pthread_barrier_t b;
int seen;
diff --git a/test/nptl/tst-cancel4.c b/test/nptl/tst-cancel4.c
index 696a527..6eaf5b1 100644
--- a/test/nptl/tst-cancel4.c
+++ b/test/nptl/tst-cancel4.c
@@ -37,8 +37,13 @@
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
+#if defined(__GLIBC__) || defined(__UCLIBC__)
#define SIGCANCEL __SIGRTMIN
+#else
+#define SIGCANCEL SIGRTMIN
+#endif
/* Since STREAMS are not supported in the standard Linux kernel and
diff --git a/test/nptl/tst-cleanup4.c b/test/nptl/tst-cleanup4.c
index 3fe3998..982bc3e 100644
--- a/test/nptl/tst-cleanup4.c
+++ b/test/nptl/tst-cleanup4.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <unistd.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
/* LinuxThreads pthread_cleanup_{push,pop} helpers. */
extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
void (*__routine) (void *),
@@ -120,11 +121,12 @@ tf (void *a)
return NULL;
}
-
+#endif
int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
int result = 0;
if (pipe (fds) != 0)
@@ -191,6 +193,9 @@ do_test (void)
}
return result;
+#else
+ return 23;
+#endif
}
#define TEST_FUNCTION do_test ()
diff --git a/test/nptl/tst-cleanup4aux.c b/test/nptl/tst-cleanup4aux.c
index 029c493..1894293 100644
--- a/test/nptl/tst-cleanup4aux.c
+++ b/test/nptl/tst-cleanup4aux.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <unistd.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *__buffer,
void (*__routine) (void *),
void *__arg);
@@ -118,3 +119,4 @@ fn9 (void)
_pthread_cleanup_pop (&b, 1);
}
+#endif
diff --git a/test/nptl/tst-clock2.c b/test/nptl/tst-clock2.c
index df6ec00..6902c25 100644
--- a/test/nptl/tst-clock2.c
+++ b/test/nptl/tst-clock2.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
+#include "../test-skeleton.h"
#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
diff --git a/test/nptl/tst-clock_nanosleep.c b/test/nptl/tst-clock_nanosleep.c
index a2d1f00..0b4ad01 100644
--- a/test/nptl/tst-clock_nanosleep.c
+++ b/test/nptl/tst-clock_nanosleep.c
@@ -20,7 +20,7 @@
#include <unistd.h>
#include <sys/time.h>
#include <time.h>
-
+#include "../test-skeleton.h"
/* Test that clock_nanosleep() does sleep. */
static int
diff --git a/test/nptl/tst-cond14.c b/test/nptl/tst-cond14.c
index 8378405..f0fe4cc 100644
--- a/test/nptl/tst-cond14.c
+++ b/test/nptl/tst-cond14.c
@@ -22,7 +22,7 @@
#include <string.h>
#include <unistd.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t mut = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static pthread_mutex_t mut2 = PTHREAD_MUTEX_INITIALIZER;
@@ -62,11 +62,12 @@ tf (void *p)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (pthread_mutex_lock (&mut2) != 0)
{
puts ("1st mutex_lock failed");
@@ -109,6 +110,9 @@ do_test (void)
puts ("done");
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-cond15.c b/test/nptl/tst-cond15.c
index 0e8448c..e4c1d72 100644
--- a/test/nptl/tst-cond15.c
+++ b/test/nptl/tst-cond15.c
@@ -24,7 +24,7 @@
#include <unistd.h>
#include <sys/time.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t mut = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static pthread_mutex_t mut2 = PTHREAD_MUTEX_INITIALIZER;
@@ -87,11 +87,12 @@ tf (void *p)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (pthread_mutex_lock (&mut2) != 0)
{
puts ("1st mutex_lock failed");
@@ -151,6 +152,9 @@ do_test (void)
puts ("done");
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-cond22.c b/test/nptl/tst-cond22.c
index bd978e5..3255cc0 100644
--- a/test/nptl/tst-cond22.c
+++ b/test/nptl/tst-cond22.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static pthread_barrier_t b;
static pthread_cond_t c = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
@@ -49,11 +49,12 @@ tf (void *arg)
}
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
int status = 0;
if (pthread_barrier_init (&b, NULL, 2) != 0)
@@ -154,6 +155,9 @@ do_test (void)
c.__data.__nwaiters, c.__data.__broadcast_seq);
return status;
+#else
+ return 23;
+#endif
}
#define TEST_FUNCTION do_test ()
diff --git a/test/nptl/tst-cond8.c b/test/nptl/tst-cond8.c
index fb13fa4..0805149 100644
--- a/test/nptl/tst-cond8.c
+++ b/test/nptl/tst-cond8.c
@@ -24,6 +24,7 @@
#include <sys/time.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t mut = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
@@ -142,11 +143,12 @@ tf2 (void *p)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_t th;
int err;
@@ -269,6 +271,9 @@ do_test (void)
puts ("done");
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-cond9.c b/test/nptl/tst-cond9.c
index dcb597d..31a6cb2 100644
--- a/test/nptl/tst-cond9.c
+++ b/test/nptl/tst-cond9.c
@@ -24,6 +24,7 @@
#include <sys/time.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t mut = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
@@ -68,11 +69,12 @@ tf (void *arg)
return (void *) 1l;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_t th;
int err;
@@ -142,6 +144,9 @@ do_test (void)
puts ("done");
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-exec2.c b/test/nptl/tst-exec2.c
index 061e3fc..c621b4e 100644
--- a/test/nptl/tst-exec2.c
+++ b/test/nptl/tst-exec2.c
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static void *
tf (void *arg)
diff --git a/test/nptl/tst-exec3.c b/test/nptl/tst-exec3.c
index be4098b..f4a6807 100644
--- a/test/nptl/tst-exec3.c
+++ b/test/nptl/tst-exec3.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
static void *
diff --git a/test/nptl/tst-flock2.c b/test/nptl/tst-flock2.c
index 941c52f..acc6972 100644
--- a/test/nptl/tst-flock2.c
+++ b/test/nptl/tst-flock2.c
@@ -21,10 +21,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <fcntl.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t lock2 = PTHREAD_MUTEX_INITIALIZER;
diff --git a/test/nptl/tst-fork1.c b/test/nptl/tst-fork1.c
index 0d89728..448255d 100644
--- a/test/nptl/tst-fork1.c
+++ b/test/nptl/tst-fork1.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
static void *
thread_function (void * arg)
diff --git a/test/nptl/tst-fork2.c b/test/nptl/tst-fork2.c
index d85ea21..e653d7e 100644
--- a/test/nptl/tst-fork2.c
+++ b/test/nptl/tst-fork2.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static pid_t initial_pid;
diff --git a/test/nptl/tst-fork3.c b/test/nptl/tst-fork3.c
index 968d0ab..434aa8f 100644
--- a/test/nptl/tst-fork3.c
+++ b/test/nptl/tst-fork3.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
static pid_t initial_pid;
diff --git a/test/nptl/tst-getpid3.c b/test/nptl/tst-getpid3.c
index f1e77f6..974cd99 100644
--- a/test/nptl/tst-getpid3.c
+++ b/test/nptl/tst-getpid3.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static pid_t pid;
diff --git a/test/nptl/tst-initializers1.c b/test/nptl/tst-initializers1.c
index 1e35380..6a458f1 100644
--- a/test/nptl/tst-initializers1.c
+++ b/test/nptl/tst-initializers1.c
@@ -18,6 +18,7 @@
#include <pthread.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_mutex_t mtx_normal = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mtx_recursive = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
pthread_mutex_t mtx_errorchk = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
@@ -26,10 +27,12 @@ pthread_rwlock_t rwl_normal = PTHREAD_RWLOCK_INITIALIZER;
pthread_rwlock_t rwl_writer
= PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
+#endif
int
main (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
if (mtx_normal.__data.__kind != PTHREAD_MUTEX_TIMED_NP)
return 1;
if (mtx_recursive.__data.__kind != PTHREAD_MUTEX_RECURSIVE_NP)
@@ -44,4 +47,7 @@ main (void)
!= PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
return 1;
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-kill6.c b/test/nptl/tst-kill6.c
index f530e4e..5b801c8 100644
--- a/test/nptl/tst-kill6.c
+++ b/test/nptl/tst-kill6.c
@@ -23,7 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-
+#include "../test-skeleton.h"
static pthread_t receiver;
static sem_t sem;
diff --git a/test/nptl/tst-mqueue1.c b/test/nptl/tst-mqueue1.c
index 5ec79cf..f07df0b 100644
--- a/test/nptl/tst-mqueue1.c
+++ b/test/nptl/tst-mqueue1.c
@@ -27,6 +27,7 @@
#include <time.h>
#include <unistd.h>
#include "tst-mqueue.h"
+#include "../test-skeleton.h"
static int
intcmp (const void *a, const void *b)
diff --git a/test/nptl/tst-mqueue3.c b/test/nptl/tst-mqueue3.c
index 5686f43..2cec763 100644
--- a/test/nptl/tst-mqueue3.c
+++ b/test/nptl/tst-mqueue3.c
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <fcntl.h>
#include <mqueue.h>
#include <signal.h>
#include <stddef.h>
@@ -28,6 +29,7 @@
#include <sys/mman.h>
#include <sys/wait.h>
#include <unistd.h>
+#include "../test-skeleton.h"
#if _POSIX_THREADS
# include <pthread.h>
diff --git a/test/nptl/tst-mqueue5.c b/test/nptl/tst-mqueue5.c
index 58e2ebf..ea6cc96 100644
--- a/test/nptl/tst-mqueue5.c
+++ b/test/nptl/tst-mqueue5.c
@@ -32,6 +32,7 @@
#include <time.h>
#include <unistd.h>
#include "tst-mqueue.h"
+#include "../test-skeleton.h"
#define TIMEOUT 3
diff --git a/test/nptl/tst-mqueue6.c b/test/nptl/tst-mqueue6.c
index 8d84c19..5f44e52 100644
--- a/test/nptl/tst-mqueue6.c
+++ b/test/nptl/tst-mqueue6.c
@@ -32,6 +32,7 @@
#include <time.h>
#include <unistd.h>
#include "tst-mqueue.h"
+#include "../test-skeleton.h"
#if _POSIX_THREADS
# include <pthread.h>
diff --git a/test/nptl/tst-mqueue8.c b/test/nptl/tst-mqueue8.c
index b80e4e5..dd12c76 100644
--- a/test/nptl/tst-mqueue8.c
+++ b/test/nptl/tst-mqueue8.c
@@ -17,11 +17,14 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <fcntl.h>
#include <mqueue.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "../test-skeleton.h"
+
#if _POSIX_THREADS
# include <pthread.h>
diff --git a/test/nptl/tst-mqueue9.c b/test/nptl/tst-mqueue9.c
index 7098b84..548157e 100644
--- a/test/nptl/tst-mqueue9.c
+++ b/test/nptl/tst-mqueue9.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <fcntl.h>
#include <mqueue.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/test/nptl/tst-mutex5.c b/test/nptl/tst-mutex5.c
index 85dddef..92fd967 100644
--- a/test/nptl/tst-mutex5.c
+++ b/test/nptl/tst-mutex5.c
@@ -32,6 +32,7 @@
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_mutex_t m;
struct timespec ts;
struct timeval tv;
@@ -178,6 +179,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#define TIMEOUT 4
diff --git a/test/nptl/tst-mutex7.c b/test/nptl/tst-mutex7.c
index 29a1423..4f9cd4b 100644
--- a/test/nptl/tst-mutex7.c
+++ b/test/nptl/tst-mutex7.c
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <time.h>
+#if defined(__GLIBC__) || defined(__UCLIBC__)
#ifndef INIT
# define INIT PTHREAD_MUTEX_INITIALIZER
@@ -59,11 +60,12 @@ tf (void *arg)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_attr_t at;
pthread_t th[N];
int cnt;
@@ -113,6 +115,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#define TIMEOUT 60
diff --git a/test/nptl/tst-mutex9.c b/test/nptl/tst-mutex9.c
index a4bb3aa..2d5bf75 100644
--- a/test/nptl/tst-mutex9.c
+++ b/test/nptl/tst-mutex9.c
@@ -26,8 +26,9 @@
#include <stdint.h>
#include <stdlib.h>
#include <sys/time.h>
+#include "../test-skeleton.h"
-int gettimeofday(struct timeval *tv, struct timezone *tz);
+//int gettimeofday(struct timeval *tv, struct timezone *tz);
static int
diff --git a/test/nptl/tst-rwlock12.c b/test/nptl/tst-rwlock12.c
index c0e5cee..695e720 100644
--- a/test/nptl/tst-rwlock12.c
+++ b/test/nptl/tst-rwlock12.c
@@ -25,7 +25,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <sys/wait.h>
-
+#include "../test-skeleton.h"
static int
do_test (void)
diff --git a/test/nptl/tst-rwlock6.c b/test/nptl/tst-rwlock6.c
index 78d0716..c3338d0 100644
--- a/test/nptl/tst-rwlock6.c
+++ b/test/nptl/tst-rwlock6.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <sys/time.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static int kind[] =
{
PTHREAD_RWLOCK_PREFER_READER_NP,
@@ -101,11 +101,12 @@ tf (void *arg)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
size_t cnt;
for (cnt = 0; cnt < sizeof (kind) / sizeof (kind[0]); ++cnt)
{
@@ -219,6 +220,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#define TEST_FUNCTION do_test ()
diff --git a/test/nptl/tst-rwlock7.c b/test/nptl/tst-rwlock7.c
index 5189a47..1367a01 100644
--- a/test/nptl/tst-rwlock7.c
+++ b/test/nptl/tst-rwlock7.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <sys/time.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
static int kind[] =
{
PTHREAD_RWLOCK_PREFER_READER_NP,
@@ -95,11 +95,12 @@ tf (void *arg)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
size_t cnt;
for (cnt = 0; cnt < sizeof (kind) / sizeof (kind[0]); ++cnt)
{
@@ -172,6 +173,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#define TEST_FUNCTION do_test ()
diff --git a/test/nptl/tst-rwlock8.c b/test/nptl/tst-rwlock8.c
index b67e55a..48034ec 100644
--- a/test/nptl/tst-rwlock8.c
+++ b/test/nptl/tst-rwlock8.c
@@ -24,7 +24,7 @@
#include <time.h>
#include <unistd.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
#define NWRITERS 15
#define WRITETRIES 10
#define NREADERS 15
@@ -109,11 +109,12 @@ reader_thread (void *nr)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_t thwr[NWRITERS];
pthread_t thrd[NREADERS];
int n;
@@ -156,6 +157,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#define TIMEOUT 30
diff --git a/test/nptl/tst-rwlock9.c b/test/nptl/tst-rwlock9.c
index e9f0151..1e4b5ca 100644
--- a/test/nptl/tst-rwlock9.c
+++ b/test/nptl/tst-rwlock9.c
@@ -25,7 +25,7 @@
#include <unistd.h>
#include <sys/time.h>
-
+#if defined(__GLIBC__) || defined(__UCLIBC__)
#define NWRITERS 15
#define WRITETRIES 10
#define NREADERS 15
@@ -147,11 +147,12 @@ reader_thread (void *nr)
return NULL;
}
-
+#endif
static int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
pthread_t thwr[NWRITERS];
pthread_t thrd[NREADERS];
int n;
@@ -194,6 +195,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#undef TIMEOUT
diff --git a/test/nptl/tst-sem1.c b/test/nptl/tst-sem1.c
index 5e55dd3..4d498bd 100644
--- a/test/nptl/tst-sem1.c
+++ b/test/nptl/tst-sem1.c
@@ -20,7 +20,7 @@
#include <semaphore.h>
#include <stdio.h>
#include <unistd.h>
-
+#include "../test-skeleton.h"
static int
do_test (void)
diff --git a/test/nptl/tst-sem10.c b/test/nptl/tst-sem10.c
index ae6218a..32170bc 100644
--- a/test/nptl/tst-sem10.c
+++ b/test/nptl/tst-sem10.c
@@ -23,6 +23,7 @@
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
+#include "../test-skeleton.h"
static int
diff --git a/test/nptl/tst-sem2.c b/test/nptl/tst-sem2.c
index edc553c..dfd66fb 100644
--- a/test/nptl/tst-sem2.c
+++ b/test/nptl/tst-sem2.c
@@ -21,6 +21,7 @@
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
+#include "../test-skeleton.h"
static int
diff --git a/test/nptl/tst-sem3.c b/test/nptl/tst-sem3.c
index 7b75e29..1b598dc 100644
--- a/test/nptl/tst-sem3.c
+++ b/test/nptl/tst-sem3.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
int
diff --git a/test/nptl/tst-sem4.c b/test/nptl/tst-sem4.c
index 72ed97d..4293b2c 100644
--- a/test/nptl/tst-sem4.c
+++ b/test/nptl/tst-sem4.c
@@ -22,7 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-
+#include "../test-skeleton.h"
static void
remove_sem (int status, void *arg)
@@ -34,6 +34,7 @@ remove_sem (int status, void *arg)
int
do_test (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
sem_t *s;
sem_t *s2;
pid_t pid;
@@ -143,6 +144,9 @@ do_test (void)
}
return 0;
+#else
+ return 23;
+#endif
}
#define TEST_FUNCTION do_test ()
diff --git a/test/nptl/tst-sem5.c b/test/nptl/tst-sem5.c
index f0b905c..396ea62 100644
--- a/test/nptl/tst-sem5.c
+++ b/test/nptl/tst-sem5.c
@@ -22,7 +22,7 @@
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
-
+#include "../test-skeleton.h"
static int
do_test (void)
diff --git a/test/nptl/tst-sem7.c b/test/nptl/tst-sem7.c
index 34ddb40..cdf0459 100644
--- a/test/nptl/tst-sem7.c
+++ b/test/nptl/tst-sem7.c
@@ -34,6 +34,7 @@ remove_sem (int status, void *arg)
int
main (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
sem_t *s;
sem_t *s2;
sem_t *s3;
@@ -105,4 +106,7 @@ main (void)
}
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-sem8.c b/test/nptl/tst-sem8.c
index 286590f..b500e28 100644
--- a/test/nptl/tst-sem8.c
+++ b/test/nptl/tst-sem8.c
@@ -34,6 +34,7 @@ remove_sem (int status, void *arg)
int
main (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
sem_t *s;
int i;
@@ -70,4 +71,7 @@ main (void)
}
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-sem9.c b/test/nptl/tst-sem9.c
index bdb594b..31918a9 100644
--- a/test/nptl/tst-sem9.c
+++ b/test/nptl/tst-sem9.c
@@ -34,6 +34,7 @@ remove_sem (int status, void *arg)
int
main (void)
{
+#if defined(__GLIBC__) || defined(__UCLIBC__)
sem_t *s;
int i;
@@ -77,4 +78,7 @@ main (void)
}
return 0;
+#else
+ return 23;
+#endif
}
diff --git a/test/nptl/tst-signal1.c b/test/nptl/tst-signal1.c
index 0f952fd..cb31108 100644
--- a/test/nptl/tst-signal1.c
+++ b/test/nptl/tst-signal1.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
static sigset_t ss;
diff --git a/test/nptl/tst-signal2.c b/test/nptl/tst-signal2.c
index 37d5611..4df0868 100644
--- a/test/nptl/tst-signal2.c
+++ b/test/nptl/tst-signal2.c
@@ -25,6 +25,7 @@
#include <sys/mman.h>
#include <sys/wait.h>
#include <string.h>
+#include "../test-skeleton.h"
static sigset_t ss;
diff --git a/test/nptl/tst-signal3.c b/test/nptl/tst-signal3.c
index fbd9ace..155a94b 100644
--- a/test/nptl/tst-signal3.c
+++ b/test/nptl/tst-signal3.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "../test-skeleton.h"
/* Number of different signalss to use. Also is the number of
diff --git a/test/nptl/tst-timer4.c b/test/nptl/tst-timer4.c
index fafb565..b8116ca 100644
--- a/test/nptl/tst-timer4.c
+++ b/test/nptl/tst-timer4.c
@@ -23,6 +23,8 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include "../test-skeleton.h"
+
#if _POSIX_THREADS
# include <pthread.h>
diff --git a/test/nptl/tst-tls2.c b/test/nptl/tst-tls2.c
index eb6d8a3..040aedb 100644
--- a/test/nptl/tst-tls2.c
+++ b/test/nptl/tst-tls2.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "../test-skeleton.h"
#define N 10
diff --git a/test/nptl/tst-tls3.c b/test/nptl/tst-tls3.c
index 3d92d91..5f54948 100644
--- a/test/nptl/tst-tls3.c
+++ b/test/nptl/tst-tls3.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include "../test-skeleton.h"
#define THE_SIG SIGUSR1
diff --git a/test/nptl/tst-tsd6.c b/test/nptl/tst-tsd6.c
index debb1dd..ea0a481 100644
--- a/test/nptl/tst-tsd6.c
+++ b/test/nptl/tst-tsd6.c
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
#define NKEYS 100
static pthread_key_t keys[NKEYS];
diff --git a/test/nptl/tst-vfork1x.c b/test/nptl/tst-vfork1x.c
index b3c9d20..02916d1 100644
--- a/test/nptl/tst-vfork1x.c
+++ b/test/nptl/tst-vfork1x.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
/* This test relies on non-POSIX functionality since the child
processes call write and getpid. */
diff --git a/test/nptl/tst-vfork2x.c b/test/nptl/tst-vfork2x.c
index 6b2d98b..a742271 100644
--- a/test/nptl/tst-vfork2x.c
+++ b/test/nptl/tst-vfork2x.c
@@ -27,6 +27,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
+#include "../test-skeleton.h"
int raise_fail;