summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-03-25 09:30:07 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-05-07 13:54:09 -0300
commit903bc7dcc2acafc40be11639767e10a2de712649 (patch)
treecee8ab271ec58e80ce0b34e33ad2c3f5f1662370 /include
parentdb373e4c57159ac82df4b07b596dd29c4cfe9d86 (diff)
downloadglibc-903bc7dcc2acafc40be11639767e10a2de712649.tar.gz
linux: Use sched_getaffinity for __get_nprocs (BZ #27645)
Both the sysfs and procfs parsing (through GET_NPROCS_PARSER) are removed in favor the syscall. The initial scratch buffer should fit to most of the common usage (1024 bytes with maps to 8192 CPUs). Checked on x86_64-linux-gnu and aarch64-linux-gnu.
Diffstat (limited to 'include')
-rw-r--r--include/bits/cpu-set.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/bits/cpu-set.h b/include/bits/cpu-set.h
index 388f03cfbd..05aa0a8cf9 100644
--- a/include/bits/cpu-set.h
+++ b/include/bits/cpu-set.h
@@ -1 +1,9 @@
+#ifndef _BITS_CPU_SET_H
#include <posix/bits/cpu-set.h>
+
+#ifndef _ISOMAC
+int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp);
+libc_hidden_proto (__sched_cpucount)
+#endif
+
+#endif /* _BITS_CPU_SET_H */