Skip to content

Commit e37f9f1

Browse files
vittyvkbonzini
authored andcommitted
selftests: kvm: fix build with glibc >= 2.30
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 <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 13fb592 commit e37f9f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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)