Skip to content

Commit 8df34c5

Browse files
compudjshuahkh
authored andcommitted
rseq/selftests: Fix: Namespace gettid() for compatibility with glibc 2.30
glibc 2.30 introduces gettid() in public headers, which clashes with the internal static definition within rseq selftests. Rename gettid() to rseq_gettid() to eliminate this symbol name clash. Reported-by: Tommi T. Rantala <tommi.t.rantala@nokia.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: Tommi T. Rantala <tommi.t.rantala@nokia.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: "Paul E. McKenney" <paulmck@linux.ibm.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: "H . Peter Anvin" <hpa@zytor.com> Cc: Paul Turner <pjt@google.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: <stable@vger.kernel.org> # v4.18+ Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent af9cb29 commit 8df34c5

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎tools/testing/selftests/rseq/param_test.c‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <errno.h>
1616
#include <stddef.h>
1717

18-
static inline pid_t gettid(void)
18+
static inline pid_t rseq_gettid(void)
1919
{
2020
return syscall(__NR_gettid);
2121
}
@@ -373,11 +373,12 @@ void *test_percpu_spinlock_thread(void *arg)
373373
rseq_percpu_unlock(&data->lock, cpu);
374374
#ifndef BENCHMARK
375375
if (i != 0 && !(i % (reps / 10)))
376-
printf_verbose("tid %d: count %lld\n", (int) gettid(), i);
376+
printf_verbose("tid %d: count %lld\n",
377+
(int) rseq_gettid(), i);
377378
#endif
378379
}
379380
printf_verbose("tid %d: number of rseq abort: %d, signals delivered: %u\n",
380-
(int) gettid(), nr_abort, signals_delivered);
381+
(int) rseq_gettid(), nr_abort, signals_delivered);
381382
if (!opt_disable_rseq && thread_data->reg &&
382383
rseq_unregister_current_thread())
383384
abort();
@@ -454,11 +455,12 @@ void *test_percpu_inc_thread(void *arg)
454455
} while (rseq_unlikely(ret));
455456
#ifndef BENCHMARK
456457
if (i != 0 && !(i % (reps / 10)))
457-
printf_verbose("tid %d: count %lld\n", (int) gettid(), i);
458+
printf_verbose("tid %d: count %lld\n",
459+
(int) rseq_gettid(), i);
458460
#endif
459461
}
460462
printf_verbose("tid %d: number of rseq abort: %d, signals delivered: %u\n",
461-
(int) gettid(), nr_abort, signals_delivered);
463+
(int) rseq_gettid(), nr_abort, signals_delivered);
462464
if (!opt_disable_rseq && thread_data->reg &&
463465
rseq_unregister_current_thread())
464466
abort();
@@ -605,7 +607,7 @@ void *test_percpu_list_thread(void *arg)
605607
}
606608

607609
printf_verbose("tid %d: number of rseq abort: %d, signals delivered: %u\n",
608-
(int) gettid(), nr_abort, signals_delivered);
610+
(int) rseq_gettid(), nr_abort, signals_delivered);
609611
if (!opt_disable_rseq && rseq_unregister_current_thread())
610612
abort();
611613

@@ -796,7 +798,7 @@ void *test_percpu_buffer_thread(void *arg)
796798
}
797799

798800
printf_verbose("tid %d: number of rseq abort: %d, signals delivered: %u\n",
799-
(int) gettid(), nr_abort, signals_delivered);
801+
(int) rseq_gettid(), nr_abort, signals_delivered);
800802
if (!opt_disable_rseq && rseq_unregister_current_thread())
801803
abort();
802804

@@ -1011,7 +1013,7 @@ void *test_percpu_memcpy_buffer_thread(void *arg)
10111013
}
10121014

10131015
printf_verbose("tid %d: number of rseq abort: %d, signals delivered: %u\n",
1014-
(int) gettid(), nr_abort, signals_delivered);
1016+
(int) rseq_gettid(), nr_abort, signals_delivered);
10151017
if (!opt_disable_rseq && rseq_unregister_current_thread())
10161018
abort();
10171019

0 commit comments

Comments
 (0)