summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 13:09:23 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-15 13:09:23 +0000
commit0621ddc423b498bc1caaac78a06496b8a22bf6fa (patch)
tree2afc892e3a5cc564be2d2ba70df91afb7943aad4
parent1451377e750cc775a5cef54419bdfc139f2e6ce0 (diff)
* ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.
CentOS 5 don't have CPU_ALLOC(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/etc/etc.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 80925f5..24548e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Oct 15 22:08:37 2014 Tanaka Akira <akr@fsij.org>
+
+ * 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 <kosaki.motohiro@gmail.com>
* ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index aaa5025..4a4df36 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();