[PATCH] Cygwin: signal: sigaction should ignore SIGKILL & SIGSTOP sliently

Yuyi Wang Strawberry_Str@hotmail.com
Sat Mar 8 08:43:05 GMT 2025


The current behavior returns EINVAL on these 2 signals, which is
different from the requirement of POSIX. In addition, it makes
posix_spawn fail to set POSIX_SPAWN_SETSIGDEF. In
newlib/libc/posix/posix_spawn.c:200, it tries to set for all signals
including SIGKILL & SIGSTOP, and sigaction should not fail.
---
  winsup/cygwin/signal.cc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index f8ba67e75..a964c3b29 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -440,7 +440,7 @@ sigaction_worker (int sig, const struct sigaction 
*newact,
                    oa.sa_handler);
            if (sig == SIGKILL || sig == SIGSTOP)
          {
-          set_errno (EINVAL);
+          res = 0;
            __leave;
          }
            struct sigaction na = *newact;
-- 
2.48.0



More information about the Cygwin-patches mailing list