Actions
Bug #861
closed1.4.3: src/tm-threads.c: cpu sets not supported on Solaris
Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Affected Versions:
Effort:
Difficulty:
Label:
Description
Solaris 10 & 11 with Sun Studio 12.3 compiler:
"tm-threads.c", line 539: warning: implicit function declaration: __builtin_expect "tm-threads.c", line 1123: syntax error before or at: * "tm-threads.c", line 1131: undefined symbol: SYS_gettid "tm-threads.c", line 1132: warning: implicit function declaration: sched_setaffinity "tm-threads.c", line 1132: undefined symbol: cs "tm-threads.c", line 1175: undefined symbol: cpu_set_t "tm-threads.c", line 1175: syntax error before or at: cs "tm-threads.c", line 1177: warning: implicit function declaration: CPU_ZERO "tm-threads.c", line 1177: undefined symbol: cs "tm-threads.c", line 1178: warning: implicit function declaration: CPU_SET "tm-threads.c", line 1282: undefined symbol: SYS_gettid "tm-threads.c", line 1297: warning: implicit function declaration: CPU_ISSET "tm-threads.c", line 1297: undefined struct/union member: lowprio_cpu "tm-threads.c", line 1299: undefined struct/union member: medprio_cpu "tm-threads.c", line 1301: undefined struct/union member: hiprio_cpu "tm-threads.c", line 1306: undefined symbol: SYS_gettid "tm-threads.c", line 1310: undefined struct/union member: cpu_set "tm-threads.c", line 1312: undefined symbol: SYS_gettid cc: acomp failed for tm-threads.c
Diff to fix is here:
--- suricata-1.4.3/src/tm-threads.c.orig Mon Jul 8 12:05:13 2013 +++ suricata-1.4.3/src/tm-threads.c Mon Jul 8 12:11:35 2013 @@ -1119,7 +1119,7 @@ return NULL; } -#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ +#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ && !defined __sun static int SetCPUAffinitySet(cpu_set_t *cs) { #if defined OS_FREEBSD int r = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_TID, @@ -1152,7 +1152,7 @@ */ static int SetCPUAffinity(uint16_t cpuid) { -#if defined __OpenBSD__ +#if defined __OpenBSD__ || defined __sun return 0; #else int cpu = (int)cpuid; @@ -1278,6 +1278,7 @@ */ TmEcode TmThreadSetupOptions(ThreadVars *tv) { +#if ! defined(__sun) if (tv->thread_setup_flags & THREAD_SET_AFFINITY) { SCLogInfo("Setting affinity for \"%s\" Module to cpu/core " "%"PRIu16", thread id %lu", tv->name, tv->cpu_affinity, @@ -1284,8 +1285,9 @@ SCGetThreadIdLong()); SetCPUAffinity(tv->cpu_affinity); } +#endif -#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ +#if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ && !defined __sun if (tv->thread_setup_flags & THREAD_SET_PRIORITY) TmThreadSetPrio(tv); if (tv->thread_setup_flags & THREAD_SET_AFFTYPE) {
Actions