summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2019-08-12 12:13:20 +0200
committerCorinna Vinschen <corinna@vinschen.de>2019-08-12 17:30:20 +0200
commit8ef2461000797cf01d88eff11189b388709c0ac8 (patch)
tree004598de515d8b2d73e6f41ef9d300c3c1d6968e
parent3b4685bf97a0649be7b19bf8efab44ca191aa6f8 (diff)
downloadcygnal-8ef2461000797cf01d88eff11189b388709c0ac8.tar.gz
cygnal-8ef2461000797cf01d88eff11189b388709c0ac8.tar.bz2
cygnal-8ef2461000797cf01d88eff11189b388709c0ac8.zip
sched.h: Declare affinity functions only on targets supporting them
-rw-r--r--newlib/libc/include/sched.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/newlib/libc/include/sched.h b/newlib/libc/include/sched.h
index 79b775e22..31599aa7e 100644
--- a/newlib/libc/include/sched.h
+++ b/newlib/libc/include/sched.h
@@ -93,10 +93,16 @@ int sched_yield( void );
#if __GNU_VISIBLE
int sched_getcpu(void);
+/* The following functions should only be declared if the type
+ cpu_set_t is defined through indirect inclusion of sys/cpuset.h,
+ only available on some targets. */
+#ifdef _SYS_CPUSET_H_
int sched_getaffinity (pid_t, size_t, cpu_set_t *);
int sched_get_thread_affinity (void *, size_t, cpu_set_t *);
int sched_setaffinity (pid_t, size_t, const cpu_set_t *);
int sched_set_thread_affinity (void *, size_t, const cpu_set_t *);
+#endif /* _SYS_CPUSET_H_ */
+
#endif
#ifdef __cplusplus