Skip to content

Commit 561cafe

Browse files
Jinrong Liangbonzini
authored andcommitted
selftests: kvm: Fix a compile error in selftests/kvm/rseq_test.c
The following warning appears when executing: make -C tools/testing/selftests/kvm rseq_test.c: In function ‘main’: rseq_test.c:237:33: warning: implicit declaration of function ‘gettid’; did you mean ‘getgid’? [-Wimplicit-function-declaration] (void *)(unsigned long)gettid()); ^~~~~~ getgid /usr/bin/ld: /tmp/ccr5mMko.o: in function `main': ../kvm/tools/testing/selftests/kvm/rseq_test.c:237: undefined reference to `gettid' collect2: error: ld returned 1 exit status make: *** [../lib.mk:173: ../kvm/tools/testing/selftests/kvm/rseq_test] Error 1 Use the more compatible syscall(SYS_gettid) instead of gettid() to fix it. More subsequent reuse may cause it to be wrapped in a lib file. Signed-off-by: Jinrong Liang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b4ac28a commit 561cafe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/rseq_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
227227
ucall_init(vm, NULL);
228228

229229
pthread_create(&migration_thread, NULL, migration_worker,
230-
(void *)(unsigned long)gettid());
230+
(void *)(unsigned long)syscall(SYS_gettid));
231231

232232
for (i = 0; !done; i++) {
233233
vcpu_run(vcpu);

0 commit comments

Comments
 (0)