diff options
| author | Yuri Victorovich <yuri@FreeBSD.org> | 2022-07-18 05:21:33 +0000 |
|---|---|---|
| committer | Yuri Victorovich <yuri@FreeBSD.org> | 2022-07-18 06:52:35 +0000 |
| commit | c7fe2fd1f66075a31d5b02046fea9e5ef583f2f6 (patch) | |
| tree | 8c3eb6abe59059b1908b59a63667b545b01ab503 /math/elpa/files/patch-src_helpers_check__thread__affinity.c | |
| parent | 66032c47b9992e747ed5ad7e11f37a710cf441bb (diff) | |
Diffstat (limited to 'math/elpa/files/patch-src_helpers_check__thread__affinity.c')
| -rw-r--r-- | math/elpa/files/patch-src_helpers_check__thread__affinity.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/math/elpa/files/patch-src_helpers_check__thread__affinity.c b/math/elpa/files/patch-src_helpers_check__thread__affinity.c index 40db36a7cd7d..5561d206753e 100644 --- a/math/elpa/files/patch-src_helpers_check__thread__affinity.c +++ b/math/elpa/files/patch-src_helpers_check__thread__affinity.c @@ -1,6 +1,6 @@ --- src/helpers/check_thread_affinity.c.orig 2021-11-16 11:26:03 UTC +++ src/helpers/check_thread_affinity.c -@@ -47,11 +47,14 @@ +@@ -47,29 +47,41 @@ // // Author: Andreas Marek, MPCDF @@ -15,12 +15,21 @@ +#include <sys/cpuset.h> #include <unistd.h> ++#if FREEBSD_OSVERSION >= 1301000 ++# define HAVE_SCHED_FUNCS // sched_getcpu() and sched_getaffinity() were added in 13.1 ++#endif -@@ -60,11 +63,11 @@ void get_thread_affinity(int *cpu_id) { + void get_thread_affinity(int *cpu_id) { ++#if defined(HAVE_SCHED_FUNCS) + *cpu_id = sched_getcpu(); ++#else ++ *cpu_id = 0; ++#endif } void get_process_affinity(int cpu_id) { - cpu_set_t set; ++#if defined(HAVE_SCHED_FUNCS) + cpuset_t set; int ret, i; int cpu; @@ -30,3 +39,9 @@ for (i=0; i < CPU_SETSIZE; i++) { cpu = CPU_ISSET(i, &set); + if (cpu == 1) { cpu_id = i; } + } ++#endif + } + + void get_process_id(int *process_id, int *pprocess_id) { |
