Skip to content

Commit 0a053b9

Browse files
vittyvkgregkh
authored andcommitted
selftests: kvm: fix build with glibc >= 2.30
[ Upstream commit e37f9f1 ] Glibc-2.30 gained gettid() wrapper, selftests fail to compile: lib/assert.c:58:14: error: static declaration of ‘gettid’ follows non-static declaration 58 | static pid_t gettid(void) | ^~~~~~ In file included from /usr/include/unistd.h:1170, from include/test_util.h:18, from lib/assert.c:10: /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here 34 | extern __pid_t gettid (void) __THROW; | ^~~~~~ Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7d9db76 commit 0a053b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tools/testing/selftests/kvm/lib/assert.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void test_dump_stack(void)
5555
#pragma GCC diagnostic pop
5656
}
5757

58-
static pid_t gettid(void)
58+
static pid_t _gettid(void)
5959
{
6060
return syscall(SYS_gettid);
6161
}
@@ -72,7 +72,7 @@ test_assert(bool exp, const char *exp_str,
7272
fprintf(stderr, "==== Test Assertion Failure ====\n"
7373
" %s:%u: %s\n"
7474
" pid=%d tid=%d - %s\n",
75-
file, line, exp_str, getpid(), gettid(),
75+
file, line, exp_str, getpid(), _gettid(),
7676
strerror(errno));
7777
test_dump_stack();
7878
if (fmt) {

0 commit comments

Comments
 (0)