bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* doc: Update regarding NetBSD
@ 2023-02-04  1:44 Bruno Haible
  2023-02-04  1:45 ` Bruno Haible
  0 siblings, 1 reply; 2+ messages in thread
From: Bruno Haible @ 2023-02-04  1:44 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 1430 bytes --]

This patch updates the documentation regarding two NetBSD bugs that I just filed
(see attachments).


2023-02-03  Bruno Haible  <bruno@clisp.org>

	doc: Update regarding NetBSD.
	* doc/posix-functions/sigprocmask.texi: Mention a NetBSD 9.0 bug.
	* doc/posix-functions/pthread_sigmask.texi: Likewise.

diff --git a/doc/posix-functions/pthread_sigmask.texi b/doc/posix-functions/pthread_sigmask.texi
index 47ee1866b0..bbea927e4f 100644
--- a/doc/posix-functions/pthread_sigmask.texi
+++ b/doc/posix-functions/pthread_sigmask.texi
@@ -35,6 +35,6 @@ Portability problems not fixed by Gnulib:
 On platforms that do not natively support this function,
 it has unspecified behavior in a multi-threaded process.
 @item
-This function may not fail when the first argument is invalid on some platforms:
-NetBSD 8.0.
+In case of failure, the return value is wrong on some platforms:
+NetBSD 9.0 when libpthread is not in use.
 @end itemize
diff --git a/doc/posix-functions/sigprocmask.texi b/doc/posix-functions/sigprocmask.texi
index 1a1379a21d..2086e6a8b2 100644
--- a/doc/posix-functions/sigprocmask.texi
+++ b/doc/posix-functions/sigprocmask.texi
@@ -15,6 +15,9 @@ mingw, MSVC 14.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+In case of failure, the return value is wrong on some platforms:
+NetBSD 9.0 when libpthread is in use.
 @end itemize
 
 Note: Although @code{sigprocmask} officially has undefined behaviour in

[-- Attachment #2: netbsd-bug1.txt --]
[-- Type: text/plain, Size: 1653 bytes --]

To: gnats-bugs@NetBSD.org
Subject: pthread_sigmask return value wrong when libpthread is not in use
From: bruno@clisp.org
Reply-To: bruno@clisp.org
X-send-pr-version: 3.95


>Submitter-Id:	net
>Originator:	
>Organization:	GNU
>Confidential:	no
>Synopsis:	The return value of pthread_sigmask is not standards compliant
>Severity:	non-critical
>Priority:	medium
>Category:	lib
>Class:		sw-bug
>Release:	NetBSD 9.0
>Environment:
System: NetBSD netbsd9.bruno.haible.de 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
When a program that is not linked with libpthread uses the pthread_sigmask
function, its return value can be wrong.
See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
section "RETURN VALUE".
>How-To-Repeat:
Compile this program
==================== foo.c ================
#include <errno.h>
#include <signal.h>
#include <stdio.h>

int main ()
{
  sigset_t set;
  int ret;

  sigemptyset (&set);
  sigaddset (&set, SIGINT);

  ret = sigprocmask (1729, &set, NULL);
  if (ret == 0)
    printf ("sigprocmask succeeded!\n");
  else
    printf ("sigprocmask -> %d, errno=%d\n", ret, errno);

  ret = pthread_sigmask (1729, &set, NULL);
  if (ret == 0)
    printf ("pthread_sigmask succeeded!\n");
  else
    printf ("pthread_sigmask -> %d\n", ret);

  return 0;
}
=============================================
$ gcc -Wall foo.c
$ ./a.out

Expected output:
sigprocmask -> -1, errno=22
pthread_sigmask -> 22

Actual output:
sigprocmask -> -1, errno=22
pthread_sigmask -> -1

>Fix:

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-04  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04  1:44 doc: Update regarding NetBSD Bruno Haible
2023-02-04  1:45 ` Bruno Haible

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).