From 11a02b035b464ab6813676adfd19c4a59c36d907 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 6 Sep 2021 12:22:54 -0300 Subject: misc: Add __get_nprocs_sched This is an internal function meant to return the number of avaliable processor where the process can scheduled, different than the __get_nprocs which returns a the system available online CPU. The Linux implementation currently only calls __get_nprocs(), which in tuns calls sched_getaffinity. Reviewed-by: Florian Weimer --- include/sys/sysinfo.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/sys') diff --git a/include/sys/sysinfo.h b/include/sys/sysinfo.h index 7388356a19..c490561581 100644 --- a/include/sys/sysinfo.h +++ b/include/sys/sysinfo.h @@ -9,10 +9,15 @@ extern int __get_nprocs_conf (void); libc_hidden_proto (__get_nprocs_conf) -/* Return number of available processors. */ +/* Return number of available processors (not all of them will be + available to the caller process). */ extern int __get_nprocs (void); libc_hidden_proto (__get_nprocs) +/* Return the number of available processors which the process can + be scheduled. */ +extern int __get_nprocs_sched (void) attribute_hidden; + /* Return number of physical pages of memory in the system. */ extern long int __get_phys_pages (void); libc_hidden_proto (__get_phys_pages) -- cgit 1.4.1