regressions/common: rename gettid wrapper to common_gettid.

glibc-2.30 added a wrapper to gettid (https://lwn.net/Articles/795127/).
gettid will clash with the glibc-provided symbol. Remove the
macro and instead move to a dedicated namespace.

We go this route to avoid introducing unnecessary complexity to
build.

Fixes #147
awsm
Samy Al Bahra 5 years ago
parent f37aa8bed6
commit b520d58d00

@ -267,13 +267,11 @@ struct affinity {
#define AFFINITY_INITIALIZER {0, 0} #define AFFINITY_INITIALIZER {0, 0}
#ifdef __linux__ #ifdef __linux__
#ifndef gettid
static pid_t static pid_t
gettid(void) common_gettid(void)
{ {
return syscall(__NR_gettid); return syscall(__NR_gettid);
} }
#endif /* gettid */
CK_CC_UNUSED static int CK_CC_UNUSED static int
aff_iterate(struct affinity *acb) aff_iterate(struct affinity *acb)
@ -285,7 +283,7 @@ aff_iterate(struct affinity *acb)
CPU_ZERO(&s); CPU_ZERO(&s);
CPU_SET(c % CORES, &s); CPU_SET(c % CORES, &s);
if (sched_setaffinity(gettid(), sizeof(s), &s) != 0) if (sched_setaffinity(common_gettid(), sizeof(s), &s) != 0)
perror("WARNING: Could not affine thread"); perror("WARNING: Could not affine thread");
return 0; return 0;
@ -300,7 +298,7 @@ aff_iterate_core(struct affinity *acb, unsigned int *core)
CPU_ZERO(&s); CPU_ZERO(&s);
CPU_SET((*core) % CORES, &s); CPU_SET((*core) % CORES, &s);
if (sched_setaffinity(gettid(), sizeof(s), &s) != 0) if (sched_setaffinity(common_gettid(), sizeof(s), &s) != 0)
perror("WARNING: Could not affine thread"); perror("WARNING: Could not affine thread");
return 0; return 0;

Loading…
Cancel
Save