bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: doc: add a note about sigprocmask vs. pthread_sigmask
Date: Sun, 28 Jun 2020 22:13:14 +0200	[thread overview]
Message-ID: <13506727.IGYX0WdNEv@omega> (raw)

Let me add a note, that explains why in Gnulib we continue to use sigprocmask()
in many places.


2020-06-28  Bruno Haible  <bruno@clisp.org>

	doc: Add a note about sigprocmask vs. pthread_sigmask.
	* doc/posix-functions/sigprocmask.texi: Add note.

diff --git a/doc/posix-functions/sigprocmask.texi b/doc/posix-functions/sigprocmask.texi
index 20b5405..9b8cae4 100644
--- a/doc/posix-functions/sigprocmask.texi
+++ b/doc/posix-functions/sigprocmask.texi
@@ -16,3 +16,10 @@ mingw, MSVC 14.
 Portability problems not fixed by Gnulib:
 @itemize
 @end itemize
+
+Note: Although @code{sigprocmask} officially has undefined behaviour in
+multi-threaded programs, in practice it is essentially equivalent to
+@code{pthread_sigmask}, with only a difference regarding the error
+return convention.  It's simpler to use @code{sigprocmask}, since it does
+not require linking with @code{-lpthread} on some platforms:
+glibc, NetBSD, OpenBSD, AIX, IRIX.



                 reply	other threads:[~2020-06-28 20:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13506727.IGYX0WdNEv@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).