]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
pthread_sigmask: Remove support for IRIX.
authorBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:14:22 +0000 (23:14 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 10 Sep 2025 21:14:35 +0000 (23:14 +0200)
* lib/pthread_sigmask.c: Remove workaround for
PTHREAD_SIGMASK_UNBLOCK_BUG.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Remove test against
IRIX bug.

ChangeLog
lib/pthread_sigmask.c
m4/pthread_sigmask.m4

index 3133dc301c112306eb8b50d7f7f3810ccd44767a..b80f924e3c78dbea445d16ae8f75a5d594433ead 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2025-09-10  Bruno Haible  <bruno@clisp.org>
 
+       pthread_sigmask: Remove support for IRIX.
+       * lib/pthread_sigmask.c: Remove workaround for
+       PTHREAD_SIGMASK_UNBLOCK_BUG.
+       * m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Remove test against
+       IRIX bug.
+
        *printf-posix: Remove support for IRIX.
        * m4/printf.m4 (gl_PRINTF_DIRECTIVE_LS, gl_PRINTF_ENOMEM,
        gl_SNPRINTF_TRUNCATION_C99, gl_SNPRINTF_DIRECTIVE_N,
index a4968f7df40830af92b0eccd9d956d99e3e31d57..11216246166b6921ec49303079e746db59258f24 100644 (file)
 # include <string.h>
 #endif
 
-#if PTHREAD_SIGMASK_UNBLOCK_BUG
-# include <unistd.h>
-#endif
-
 int
 pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
 #undef pthread_sigmask
@@ -73,16 +69,6 @@ pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
 # if PTHREAD_SIGMASK_FAILS_WITH_ERRNO
   if (ret == -1)
     return errno;
-# endif
-# if PTHREAD_SIGMASK_UNBLOCK_BUG
-  if (ret == 0
-      && new_mask != NULL
-      && (how == SIG_UNBLOCK || how == SIG_SETMASK))
-    {
-      /* Give the OS the opportunity to raise signals that were pending before
-         the pthread_sigmask call and have now been unblocked.  */
-      usleep (1);
-    }
 # endif
   return ret;
 #else
index a9da33c4c382885eb6ac2a9b3ed143cb9d844698..77991d4f334d53de5743e707fa859ecd65ce9540 100644 (file)
@@ -1,5 +1,5 @@
 # pthread_sigmask.m4
-# serial 23
+# serial 24
 dnl Copyright (C) 2011-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -97,7 +97,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
         HAVE_PTHREAD_SIGMASK=0
         dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
         dnl so as to not accidentally override the system's pthread_sigmask
-        dnl symbol from libpthread. This is necessary on IRIX 6.5.
+        dnl symbol from libpthread.
         REPLACE_PTHREAD_SIGMASK=1
       fi
     ])
@@ -199,76 +199,6 @@ int main ()
           [Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.])
         ;;
     esac
-
-    dnl On IRIX 6.5, in a single-threaded program, pending signals are not
-    dnl immediately delivered when they are unblocked through pthread_sigmask,
-    dnl only a little while later.
-    AC_CACHE_CHECK([whether pthread_sigmask unblocks signals correctly],
-      [gl_cv_func_pthread_sigmask_unblock_works],
-      [
-        case "$host_os" in
-          irix*)
-            gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
-          *)
-            gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
-        esac
-        m4_ifdef([gl_][THREADLIB],
-          [dnl Link against $LIBMULTITHREAD, not only $PTHREAD_SIGMASK_LIB.
-           dnl Otherwise we get a false positive on those platforms where
-           dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
-           gl_saved_LIBS=$LIBS
-           LIBS="$LIBS $LIBMULTITHREAD"])
-        AC_RUN_IFELSE(
-          [AC_LANG_SOURCE([[
-#include <limits.h>
-#include <pthread.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-]GL_MDA_DEFINES[
-static volatile int sigint_occurred;
-static void
-sigint_handler (int sig)
-{
-  sigint_occurred++;
-}
-int main ()
-{
-  sigset_t set;
-  pid_t pid = getpid ();
-  char command[80];
-  if (LONG_MAX < pid)
-    return 6;
-  signal (SIGINT, sigint_handler);
-  sigemptyset (&set);
-  sigaddset (&set, SIGINT);
-  if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
-    return 1;
-  sprintf (command, "sh -c 'sleep 1; kill -INT %ld' &", (long) pid);
-  if (!(system (command) == 0))
-    return 2;
-  sleep (2);
-  if (!(sigint_occurred == 0))
-    return 3;
-  if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
-    return 4;
-  if (!(sigint_occurred == 1)) /* This fails on IRIX.  */
-    return 5;
-  return 0;
-}]])],
-          [:],
-          [gl_cv_func_pthread_sigmask_unblock_works=no],
-          [:])
-        m4_ifdef([gl_][THREADLIB], [LIBS=$gl_saved_LIBS])
-      ])
-    case "$gl_cv_func_pthread_sigmask_unblock_works" in
-      *no)
-        REPLACE_PTHREAD_SIGMASK=1
-        AC_DEFINE([PTHREAD_SIGMASK_UNBLOCK_BUG], [1],
-          [Define to 1 if pthread_sigmask() unblocks signals incorrectly.])
-        ;;
-    esac
   fi
 ])