diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-23 11:29:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-07-23 11:37:28 +0000 |
commit | a7283ab143d4e95e8f5f22b58c61cb4e2f604749 (patch) | |
tree | 3ec5165ac7f1299f5c0dc3e41d7560a06e6267f5 /regressions/common.h | |
parent | Adding debian version 0.6.0-2. (diff) | |
download | ck-a7283ab143d4e95e8f5f22b58c61cb4e2f604749.tar.xz ck-a7283ab143d4e95e8f5f22b58c61cb4e2f604749.zip |
Merging upstream version 0.7.1 (Closes: #991419).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'regressions/common.h')
-rw-r--r-- | regressions/common.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/regressions/common.h b/regressions/common.h index f67c2af..9cdc690 100644 --- a/regressions/common.h +++ b/regressions/common.h @@ -267,13 +267,11 @@ struct affinity { #define AFFINITY_INITIALIZER {0, 0} #ifdef __linux__ -#ifndef gettid static pid_t -gettid(void) +common_gettid(void) { return syscall(__NR_gettid); } -#endif /* gettid */ CK_CC_UNUSED static int aff_iterate(struct affinity *acb) @@ -285,7 +283,10 @@ aff_iterate(struct affinity *acb) CPU_ZERO(&s); CPU_SET(c % CORES, &s); - return sched_setaffinity(gettid(), sizeof(s), &s); + if (sched_setaffinity(common_gettid(), sizeof(s), &s) != 0) + perror("WARNING: Could not affine thread"); + + return 0; } CK_CC_UNUSED static int @@ -297,7 +298,10 @@ aff_iterate_core(struct affinity *acb, unsigned int *core) CPU_ZERO(&s); CPU_SET((*core) % CORES, &s); - return sched_setaffinity(gettid(), sizeof(s), &s); + if (sched_setaffinity(common_gettid(), sizeof(s), &s) != 0) + perror("WARNING: Could not affine thread"); + + return 0; } #elif defined(__MACH__) CK_CC_UNUSED static int |