This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What *is* the API for sched_getaffinity? Should sched_getaffinity always succeed when using cpu_set_t?


Example, my x86 machine show:

$ cat /sys/devices/system/cpu/possible
0-31

$ find  /sys/devices/system/cpu -maxdepth  1 -name 'cpu[0-9]*'
/sys/devices/system/cpu/cpu0
/sys/devices/system/cpu/cpu1
/sys/devices/system/cpu/cpu2
/sys/devices/system/cpu/cpu3
/sys/devices/system/cpu/cpu4
/sys/devices/system/cpu/cpu5
/sys/devices/system/cpu/cpu6
/sys/devices/system/cpu/cpu7

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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]