bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 03/10] pthread_sigmask: new module


From: Bruno Haible
Subject: Re: [PATCH 03/10] pthread_sigmask: new module
Date: Fri, 8 Jul 2011 02:28:01 +0200
User-agent: KMail/1.9.9

On FreeBSD 6.4, in a unit test that checks the signature of pthread_sigmask(),
I get a compilation error:

test-pthread_sigmask1.c:24: error: `pthread_sigmask' undeclared here (not in a 
function)
*** Error code 1

Similarly on a couple of other platforms. The reason is that the system
declares it in <pthread.h>, not <signal.h>.

This fixes it:


2011-07-07  Bruno Haible  <address@hidden>

        pthread_sigmask: Ensure declaration in <signal.h>.
        * lib/signal.in.h: On MacOS X, FreeBSD, OpenBSD, OSF/1, include
        <pthread.h>.
        * doc/posix-functions/pthread_sigmask.texi: Mention the header file
        problem.

--- doc/posix-functions/pthread_sigmask.texi.orig       Fri Jul  8 02:22:23 2011
+++ doc/posix-functions/pthread_sigmask.texi    Fri Jul  8 02:21:50 2011
@@ -11,6 +11,10 @@
 @item
 This function is missing on some platforms:
 Solaris 2.4, mingw, BeOS.
address@hidden
+This function is declared in @code{<pthread.h>} instead of @code{<signal.h>}
+on some platforms:
+MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0.
 @end itemize
 
 Portability problems not fixed by Gnulib:
--- lib/signal.in.h.orig        Fri Jul  8 02:22:23 2011
+++ lib/signal.in.h     Fri Jul  8 02:09:25 2011
@@ -55,6 +55,15 @@
 #ifndef address@hidden@_SIGNAL_H
 #define address@hidden@_SIGNAL_H
 
+/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0 declare pthread_sigmask in
+   <pthread.h>, not in <signal.h>.
+   But avoid namespace pollution on glibc systems.*/
+#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+    && ((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || 
defined __OpenBSD__ || defined __osf__) \
+    && ! defined __GLIBC__
+# include <pthread.h>
+#endif
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
-- 
In memoriam Georges Mandel <http://en.wikipedia.org/wiki/Georges_Mandel>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]