diff --git a/ChangeLog b/ChangeLog index 80925f5867..24548e2d13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Oct 15 22:08:37 2014 Tanaka Akira + + * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability. + CentOS 5 don't have CPU_ALLOC(). + Wed Oct 15 18:26:19 2014 KOSAKI Motohiro * ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity diff --git a/ext/etc/etc.c b/ext/etc/etc.c index aaa5025a9c..4a4df3654a 100644 --- a/ext/etc/etc.c +++ b/ext/etc/etc.c @@ -909,7 +909,7 @@ io_pathconf(VALUE io, VALUE arg) #if (defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)) || defined(_WIN32) -#ifdef HAVE_SCHED_GETAFFINITY +#if defined(HAVE_SCHED_GETAFFINITY) && defined(CPU_ALLOC) static int etc_nprocessors_affin(void) { @@ -987,7 +987,7 @@ etc_nprocessors(VALUE obj) #if !defined(_WIN32) -#ifdef HAVE_SCHED_GETAFFINITY +#if defined(HAVE_SCHED_GETAFFINITY) && defined(CPU_ALLOC) int ncpus; ncpus = etc_nprocessors_affin();