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: "Carlos O'Donell" <carlos at redhat dot com>
- To: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- Cc: chrubis at suse dot cz, libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 18 Jul 2013 05:08:08 -0400
- 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> <20130716110445 dot GA20826 at rei> <CAHGf_=qxR-abdjwmJUw8vApSioDhKhvsc54Yx-fpw5V-whpioQ at mail dot gmail dot com> <51E5DCB2 dot 1070305 at gmail dot com> <20130717100527 dot GA24881 at rei> <51E6EA7E dot 6050601 at gmail dot com> <51E6F3B3 dot 4030307 at gmail dot com> <51E7237F dot 2040400 at gmail dot com>
On 07/17/2013 07:06 PM, KOSAKI Motohiro wrote:
>> And, this is match w/ /sys/devices/system/cpu/present.
>
> btw, Needless to say, sysconf (_SC_NPROCESSORS_CONF) should read
> /sys/devices/system/cpu/present if it exist because directory reading
> is not atomic operation and might lead to scary result.
glibc counts the individual cpuX entries.
It would be an enhancement to read and parse `present' ;-)
Cheers,
Carlos.