diff options
-rw-r--r-- | DAnCE/ChangeLog | 6 | ||||
-rw-r--r-- | DAnCE/dance/LocalityManager/Configuration/CPU_Affinity.cpp | 16 |
2 files changed, 10 insertions, 12 deletions
diff --git a/DAnCE/ChangeLog b/DAnCE/ChangeLog index 0b3da695184..a17a65f231c 100644 --- a/DAnCE/ChangeLog +++ b/DAnCE/ChangeLog @@ -1,3 +1,9 @@ +Fri Aug 9 16:54:51 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl> + + * dance/LocalityManager/Configuration/CPU_Affinity.cpp: + Use ACE_HAS_SCHED_SETAFFINITY instead of checking the + linux kernel version here + Fri Aug 9 08:33:10 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl> * tools/Config_Handlers/DynAny_Handler/DataType_Handler.cpp: diff --git a/DAnCE/dance/LocalityManager/Configuration/CPU_Affinity.cpp b/DAnCE/dance/LocalityManager/Configuration/CPU_Affinity.cpp index cb83959df15..9a60bde8972 100644 --- a/DAnCE/dance/LocalityManager/Configuration/CPU_Affinity.cpp +++ b/DAnCE/dance/LocalityManager/Configuration/CPU_Affinity.cpp @@ -3,18 +3,12 @@ #include "CPU_Affinity.h" #include "dance/DAnCE_PropertiesC.h" #include "dance/Deployment/Deployment_StartErrorC.h" - #include "dance/Logger/Log_Macros.h" - -#if defined (LINUX_VERSION_CODE) && defined (KERNEL_VERSION) -# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,8)) -#include <sched.h> -#include <sstream> +#include "ace/os_include/os_sched.h" #include "ace/Auto_Ptr.h" #include "ace/Tokenizer_T.h" #include "ace/OS_NS_unistd.h" -#endif -#endif +#include <sstream> namespace DAnCE { @@ -34,9 +28,8 @@ namespace DAnCE void CPU_Affinity::configure (const ::Deployment::Property & prop) { -#if defined (LINUX_VERSION_CODE) && defined (KERNEL_VERSION) -# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,8)) - const char *extracted_affinity; +#if defined (ACE_HAS_SCHED_SETAFFINITY) + const char *extracted_affinity = 0; if (! (prop.value >>= CORBA::Any::to_string (extracted_affinity, 0))) { @@ -111,7 +104,6 @@ namespace DAnCE return; #endif -#endif throw ::Deployment::StartError (prop.name.in (), "CPU Affinity not supported on this platform"); |