Skip to content
  • Lasse Collin's avatar
    427157065465
    tuklib_cpucores: Add support for sched_getaffinity(). · 427157065465
    Lasse Collin authored
    It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better
    than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity()
    gives the number of cores available to the process instead of
    the total number of cores online.
    
    As a side effect, this commit fixes a bug on GNU/kFreeBSD where
    configure would detect the FreeBSD-specific cpuset_getaffinity()
    but it wouldn't actually work because on GNU/kFreeBSD it requires
    using -lfreebsd-glue when linking. Now the glibc-specific function
    will be used instead.
    
    Thanks to Sebastian Andrzej Siewior for the original patch
    and testing.
    427157065465
    tuklib_cpucores: Add support for sched_getaffinity().
    Lasse Collin authored
    It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better
    than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity()
    gives the number of cores available to the process instead of
    the total number of cores online.
    
    As a side effect, this commit fixes a bug on GNU/kFreeBSD where
    configure would detect the FreeBSD-specific cpuset_getaffinity()
    but it wouldn't actually work because on GNU/kFreeBSD it requires
    using -lfreebsd-glue when linking. Now the glibc-specific function
    will be used instead.
    
    Thanks to Sebastian Andrzej Siewior for the original patch
    and testing.
Loading