Skip to content

Conversation

@bojle
Copy link
Contributor

@bojle bojle commented Nov 2, 2025

Fixes: #166059

bojle added 2 commits November 2, 2025 16:38
ExecuteFunctionUnix.cpp which is guarded by this check should reliably work
on darwin as it only uses POSIX API - nothing specific to linux.
Fixes: llvm#166059

Signed-off-by: Shreeyash Pandey <shreeyash335@gmail.com>
@llvmbot llvmbot added the libc label Nov 2, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 2, 2025

@llvm/pr-subscribers-libc

Author: Shreeyash Pandey (bojle)

Changes

Fixes: #166059


Full diff: https://github.com/llvm/llvm-project/pull/166065.diff

2 Files Affected:

  • (modified) libc/test/UnitTest/CMakeLists.txt (+1-1)
  • (modified) libc/test/UnitTest/ExecuteFunctionUnix.cpp (+2-1)
diff --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt
index 31d1e9dce8204..028e8e3a2ea67 100644
--- a/libc/test/UnitTest/CMakeLists.txt
+++ b/libc/test/UnitTest/CMakeLists.txt
@@ -83,7 +83,7 @@ add_unittest_framework_library(
 )
 
 set(libc_death_test_srcs LibcDeathTestExecutors.cpp)
-if(${LIBC_TARGET_OS} STREQUAL "linux")
+if(${LIBC_TARGET_OS} STREQUAL "linux" OR ${LIBC_TARGET_OS} STREQUAL "darwin")
   list(APPEND libc_death_test_srcs ExecuteFunctionUnix.cpp)
 endif()
 
diff --git a/libc/test/UnitTest/ExecuteFunctionUnix.cpp b/libc/test/UnitTest/ExecuteFunctionUnix.cpp
index c0e85c2144005..0b450578adde2 100644
--- a/libc/test/UnitTest/ExecuteFunctionUnix.cpp
+++ b/libc/test/UnitTest/ExecuteFunctionUnix.cpp
@@ -13,6 +13,7 @@
 #include <poll.h>
 #include <signal.h>
 #include <stdio.h>
+#include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/wait.h>
@@ -58,7 +59,7 @@ ProcessStatus invoke_in_subprocess(FunctionCaller *func, int timeout_ms) {
   ::close(pipe_fds[1]);
 
   struct pollfd poll_fd {
-    pipe_fds[0], 0, 0
+    pipe_fds[0], POLLIN, 0
   };
   // No events requested so this call will only return after the timeout or if
   // the pipes peer was closed, signaling the process exited.

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@bojle
Copy link
Contributor Author

bojle commented Nov 2, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[libc] EXPECT_EXIT timeouts on darwin

3 participants