From 903bc7dcc2acafc40be11639767e10a2de712649 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 25 Mar 2021 09:30:07 -0300 Subject: 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. --- include/bits/cpu-set.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/bits') 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 + +#ifndef _ISOMAC +int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp); +libc_hidden_proto (__sched_cpucount) +#endif + +#endif /* _BITS_CPU_SET_H */ -- cgit v1.2.3