[PATCH] regressions/common: rename gettid wrapper to common_gettid.
authorSamy Al Bahra <sbahra@backtrace.io>
Tue, 29 Oct 2019 21:30:09 +0000 (17:30 -0400)
committerJCF Ploemen (jcfp) <linux@jcf.pm>
Sat, 4 Apr 2020 05:20:03 +0000 (06:20 +0100)
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

Gbp-Pq: Name glibc-2.30.patch

regressions/common.h

index f67c2af19181706991fd06cccc6eebf511ab9ccf..646bb102f6a9d7b5c27f6cfefbdcb51d81602843 100644 (file)
@@ -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,7 @@ aff_iterate(struct affinity *acb)
        CPU_ZERO(&s);
        CPU_SET(c % CORES, &s);
 
-       return sched_setaffinity(gettid(), sizeof(s), &s);
+       return sched_setaffinity(common_gettid(), sizeof(s), &s);
 }
 
 CK_CC_UNUSED static int
@@ -297,7 +295,7 @@ aff_iterate_core(struct affinity *acb, unsigned int *core)
        CPU_ZERO(&s);
        CPU_SET((*core) % CORES, &s);
 
-       return sched_setaffinity(gettid(), sizeof(s), &s);
+       return sched_setaffinity(common_gettid(), sizeof(s), &s);
 }
 #elif defined(__MACH__)
 CK_CC_UNUSED static int