From: Bruno Haible Date: Sun, 28 Jun 2020 20:10:32 +0000 (+0200) Subject: doc: Add a note about sigprocmask vs. pthread_sigmask. X-Git-Tag: v1.0~3949 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3f70affe3ee2c5378965c8bf9d235af54837ec15;p=gnulib.git doc: Add a note about sigprocmask vs. pthread_sigmask. * doc/posix-functions/sigprocmask.texi: Add note. --- diff --git a/ChangeLog b/ChangeLog index ce8dc4cfc2..84a1bd4727 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2020-06-28 Bruno Haible + + doc: Add a note about sigprocmask vs. pthread_sigmask. + * doc/posix-functions/sigprocmask.texi: Add note. + 2020-06-28 Bruno Haible getrandom: Fix compilation errors on older versions of mingw. diff --git a/doc/posix-functions/sigprocmask.texi b/doc/posix-functions/sigprocmask.texi index 20b5405e00..1a1379a21d 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.