[libc-commits] [libc] [libc] End a semaphore wait with EINTR when a signal handler runs (PR #236969)

Mike Lothian via libc-commits libc-commits at lists.llvm.org
Fri Oct 30 08:54:07 PDT 2026


================
@@ -146,3 +150,25 @@ TEST_F(LlvmLibcSemWaitTest, ClockWaitUnsupportedClock) {
 
   ASSERT_THAT(LIBC_NAMESPACE::sem_destroy(&sem), Succeeds());
 }
+
+static void on_alarm(int) {}
+
+TEST_F(LlvmLibcSemWaitTest, ASignalHandlerEndsTheWaitWithEINTR) {
+  struct sigaction action{};
+  action.sa_handler = on_alarm;
----------------
FireBurn wrote:

Done, the handler is a lambda now

https://github.com/llvm/llvm-project/pull/236969


More information about the libc-commits mailing list