On 2026-04-10 14:12, Bruno Haible wrote:
This patch should fulfil your needs.

Thanks, I think it does and I updated gzip accordingly.


+You may define the C macro @code{GNULIB_SIGPROCMASK_SINGLE_THREAD}, if all the
+programs in your package invoke the functions of the @code{sigprocmask} module
+(in particular, @code{sigprocmask}, @code{pthread_sigmask}, @code{signal}, and
+@code{sigaction}) only from a single thread.

I was confused by this, as Gnulib-using programs should invoke sigprocmask only from single-threaded processes regardless of whether GNULIB_SIGPROCMASK_SINGLE_THREAD is defined. Also, not all functions of the sigprocmask module are affected by this module. Also, sigaction is not a function of the sigprocmask module. I installed the attached doc patch to try to clarify all this.
From fc2a05f786479d64ac90821bbb255b755ffb6258 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sat, 11 Apr 2026 09:36:46 -0700
Subject: [PATCH] sigprocmask: clarify GNULIB_SIGPROCMASK_SINGLE_THREAD doc

---
 doc/multithread.texi | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/multithread.texi b/doc/multithread.texi
index f53f5d6a77..8771e4a674 100644
--- a/doc/multithread.texi
+++ b/doc/multithread.texi
@@ -324,9 +324,15 @@ You can get this macro defined by including the Gnulib module
 @code{wchar-single}.
 @item
 You may define the C macro @code{GNULIB_SIGPROCMASK_SINGLE_THREAD}, if all the
-programs in your package invoke the functions of the @code{sigprocmask} module
-(in particular, @code{sigprocmask}, @code{pthread_sigmask}, @code{signal}, and
-@code{sigaction}) only from a single thread.
+package's programs call the following functions only from a single thread:
+@code{pthread_sigmask}, @code{sigaction}, @code{signal}, @code{sigpending}.
+Regardless of whether this macro is defined, only single-threaded processes
+should call the @code{sigprocmask} function itself (@pxref{sigprocmask}).
+The macro is named after @code{sigprocmask} because it affects
+Gnulib's implementation of @code{sigprocmask} on native Windows,
+the only platform where the macro has any effect,
+and the other functions' Gnulib implementations use Gnulib
+@code{sigprocmask} on native Windows.
 @item
 You may define the C macro @code{GNULIB_EXCLUDE_SINGLE_THREAD}, if all the
 programs in your package invoke the functions of the @code{exclude} module
-- 
2.51.0

Reply via email to