diff mbox series

[COMMITTED] support: Do not build xpthread_attr_setaffinity_np for hurd

Message ID 20210528190206.2014040-1-adhemerval.zanella@linaro.org
State New
Headers show
Series [COMMITTED] support: Do not build xpthread_attr_setaffinity_np for hurd | expand

Commit Message

Adhemerval Zanella May 28, 2021, 7:02 p.m. UTC
It does not provide pthread_attr_setaffinity_np extension.
---
 support/xpthread_attr_setaffinity_np.c | 2 ++
 support/xthread.h                      | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/support/xpthread_attr_setaffinity_np.c b/support/xpthread_attr_setaffinity_np.c
index 5bb5b419a5..21a768c03f 100644
--- a/support/xpthread_attr_setaffinity_np.c
+++ b/support/xpthread_attr_setaffinity_np.c
@@ -18,6 +18,7 @@ 
 
 #include <support/xthread.h>
 
+#ifdef __linux__
 void
 xpthread_attr_setaffinity_np (pthread_attr_t *attr,
                               size_t cpusetsize, const cpu_set_t *cpuset)
@@ -26,3 +27,4 @@  xpthread_attr_setaffinity_np (pthread_attr_t *attr,
 			 pthread_attr_setaffinity_np (attr, cpusetsize,
 						      cpuset));
 }
+#endif
diff --git a/support/xthread.h b/support/xthread.h
index c0dbb6086e..a4a4ec5b1e 100644
--- a/support/xthread.h
+++ b/support/xthread.h
@@ -66,9 +66,11 @@  void *xpthread_join (pthread_t thr);
 void xpthread_once (pthread_once_t *guard, void (*func) (void));
 void xpthread_attr_destroy (pthread_attr_t *attr);
 void xpthread_attr_init (pthread_attr_t *attr);
+#ifdef __linux__
 void xpthread_attr_setaffinity_np (pthread_attr_t *attr,
 				   size_t cpusetsize,
 				   const cpu_set_t *cpuset);
+#endif
 void xpthread_attr_setdetachstate (pthread_attr_t *attr,
 				   int detachstate);
 void xpthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,