[前][次][番号順一覧][スレッド一覧]

ruby-changes:35861

From: akr <ko1@a...>
Date: Wed, 15 Oct 2014 22:09:37 +0900 (JST)
Subject: [ruby-changes:35861] akr:r47943 (trunk): * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.

akr	2014-10-15 22:09:23 +0900 (Wed, 15 Oct 2014)

  New Revision: 47943

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47943

  Log:
    * ext/etc/etc.c (etc_nprocessors_affin): Test CPU_ALLOC availability.
      CentOS 5 don't have CPU_ALLOC().

  Modified files:
    trunk/ChangeLog
    trunk/ext/etc/etc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47942)
+++ ChangeLog	(revision 47943)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Oct 15 22:08:37 2014  Tanaka Akira  <akr@f...>
+
+	* 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@g...>
 
 	* ext/etc/etc.c (etc_nprocessors_affinity): use sched_getaffinity
Index: ext/etc/etc.c
===================================================================
--- ext/etc/etc.c	(revision 47942)
+++ ext/etc/etc.c	(revision 47943)
@@ -909,7 +909,7 @@ io_pathconf(VALUE io, VALUE arg) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L909
 
 #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) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L987
 
 #if !defined(_WIN32)
 
-#ifdef HAVE_SCHED_GETAFFINITY
+#if defined(HAVE_SCHED_GETAFFINITY) && defined(CPU_ALLOC)
     int ncpus;
 
     ncpus = etc_nprocessors_affin();

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]