summaryrefslogtreecommitdiff
path: root/test/nptl/tst-attr3.c
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/tst-attr3.c
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/tst-attr3.c')
-rw-r--r--test/nptl/tst-attr3.c11
1 files changed, 11 insertions, 0 deletions
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)