diff --git a/libc/test/src/__support/threads/linux/raw_mutex_test.cpp b/libc/test/src/__support/threads/linux/raw_mutex_test.cpp index 814f6f14c87b98..aff6c8be0cb1b3 100644 --- a/libc/test/src/__support/threads/linux/raw_mutex_test.cpp +++ b/libc/test/src/__support/threads/linux/raw_mutex_test.cpp @@ -63,7 +63,11 @@ TEST(LlvmLibcSupportThreadsRawMutexTest, PSharedLock) { shared->data = 0; LIBC_NAMESPACE::RawMutex::init(&shared->mutex); // Avoid pull in our own implementation of pthread_t. +#ifdef SYS_fork long pid = LIBC_NAMESPACE::syscall_impl(SYS_fork); +#elif defined(SYS_clone) + long pid = LIBC_NAMESPACE::syscall_impl(SYS_clone, SIGCHLD, 0); +#endif for (int i = 0; i < 10000; ++i) { shared->mutex.lock(LIBC_NAMESPACE::cpp::nullopt, true); shared->data++;