This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?
- From: chrubis at suse dot cz
- To: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 16 Jul 2013 13:04:45 +0200
- Subject: Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?
- References: <51E42BFE dot 7000301 at redhat dot com> <51E4A0BB dot 2070802 at gmail dot com>
Hi!
> /sys/devices/system/cpu/possible returns possible cpu mask. AFAIK, unfortunately,
> sysconf() doesn't support to get possible cpus.
There is _SC_NPROCESSORS_CONF and get_nprocs_conf() that counts number
of directories with cpu prefix in '/sys/devices/system/'.
--
Cyril Hrubis
chrubis@suse.cz