forked from OSchip/llvm-project
tsan: fix fork syscall test
Arm64 builders failed with: error: use of undeclared identifier 'SYS_fork' https://lab.llvm.org/buildbot/#/builders/7/builds/2575 Indeed, not all arches have fork syscall. Implement fork via clone on these arches. Differential Revision: https://reviews.llvm.org/D101603
This commit is contained in:
parent
97ed1b6036
commit
b6df852901
|
@ -16,7 +16,11 @@ static void *incrementer(void *p) {
|
|||
|
||||
int myfork() {
|
||||
__sanitizer_syscall_pre_fork();
|
||||
#ifdef SYS_fork
|
||||
int res = syscall(SYS_fork);
|
||||
#else
|
||||
int res = syscall(SYS_clone, SIGCHLD, 0);
|
||||
#endif
|
||||
__sanitizer_syscall_post_fork(res);
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue