Skip to content

Commit 8057756

Browse files
[libc] fix test build on platforms without SYS_fork (#94087)
1 parent 85fd168 commit 8057756

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libc/test/src/__support/threads/linux/raw_mutex_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ TEST(LlvmLibcSupportThreadsRawMutexTest, PSharedLock) {
6363
shared->data = 0;
6464
LIBC_NAMESPACE::RawMutex::init(&shared->mutex);
6565
// Avoid pull in our own implementation of pthread_t.
66+
#ifdef SYS_fork
6667
long pid = LIBC_NAMESPACE::syscall_impl<long>(SYS_fork);
68+
#elif defined(SYS_clone)
69+
long pid = LIBC_NAMESPACE::syscall_impl<long>(SYS_clone, SIGCHLD, 0);
70+
#endif
6771
for (int i = 0; i < 10000; ++i) {
6872
shared->mutex.lock(LIBC_NAMESPACE::cpp::nullopt, true);
6973
shared->data++;

0 commit comments

Comments
 (0)