version 1.1.1.2, 2012/05/29 09:29:43
|
version 1.1.1.3, 2021/03/17 13:38:46
|
Line 1
|
Line 1
|
/* A GNU-like <signal.h>. |
/* A GNU-like <signal.h>. |
|
|
Copyright (C) 2006-2011 Free Software Foundation, Inc. | Copyright (C) 2006-2019 Free Software Foundation, Inc. |
|
|
This program is free software: you can redistribute it and/or modify |
This program is free software: you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
Line 13
|
Line 13
|
GNU General Public License for more details. |
GNU General Public License for more details. |
|
|
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
|
|
#if __GNUC__ >= 3 |
#if __GNUC__ >= 3 |
@PRAGMA_SYSTEM_HEADER@ |
@PRAGMA_SYSTEM_HEADER@ |
Line 55
|
Line 55
|
#ifndef _@GUARD_PREFIX@_SIGNAL_H |
#ifndef _@GUARD_PREFIX@_SIGNAL_H |
#define _@GUARD_PREFIX@_SIGNAL_H |
#define _@GUARD_PREFIX@_SIGNAL_H |
|
|
/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare | /* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android |
pthread_sigmask in <pthread.h>, not in <signal.h>. | declare pthread_sigmask in <pthread.h>, not in <signal.h>. |
But avoid namespace pollution on glibc systems.*/ |
But avoid namespace pollution on glibc systems.*/ |
#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ |
#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \ |
&& ((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ || defined __sun) \ | && ((defined __APPLE__ && defined __MACH__) \ |
| || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \ |
| || defined __sun || defined __ANDROID__) \ |
&& ! defined __GLIBC__ |
&& ! defined __GLIBC__ |
# include <pthread.h> |
# include <pthread.h> |
#endif |
#endif |
Line 135 _GL_FUNCDECL_RPL (pthread_sigmask, int,
|
Line 137 _GL_FUNCDECL_RPL (pthread_sigmask, int,
|
_GL_CXXALIAS_RPL (pthread_sigmask, int, |
_GL_CXXALIAS_RPL (pthread_sigmask, int, |
(int how, const sigset_t *new_mask, sigset_t *old_mask)); |
(int how, const sigset_t *new_mask, sigset_t *old_mask)); |
# else |
# else |
# if !@HAVE_PTHREAD_SIGMASK@ | # if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask) |
_GL_FUNCDECL_SYS (pthread_sigmask, int, |
_GL_FUNCDECL_SYS (pthread_sigmask, int, |
(int how, const sigset_t *new_mask, sigset_t *old_mask)); |
(int how, const sigset_t *new_mask, sigset_t *old_mask)); |
# endif |
# endif |
Line 152 _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is
|
Line 154 _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is
|
#endif |
#endif |
|
|
|
|
|
#if @GNULIB_RAISE@ |
|
# if @REPLACE_RAISE@ |
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
|
# undef raise |
|
# define raise rpl_raise |
|
# endif |
|
_GL_FUNCDECL_RPL (raise, int, (int sig)); |
|
_GL_CXXALIAS_RPL (raise, int, (int sig)); |
|
# else |
|
# if !@HAVE_RAISE@ |
|
_GL_FUNCDECL_SYS (raise, int, (int sig)); |
|
# endif |
|
_GL_CXXALIAS_SYS (raise, int, (int sig)); |
|
# endif |
|
_GL_CXXALIASWARN (raise); |
|
#elif defined GNULIB_POSIXCHECK |
|
# undef raise |
|
/* Assume raise is always declared. */ |
|
_GL_WARN_ON_USE (raise, "raise can crash on native Windows - " |
|
"use gnulib module raise for portability"); |
|
#endif |
|
|
|
|
#if @GNULIB_SIGPROCMASK@ |
#if @GNULIB_SIGPROCMASK@ |
# if !@HAVE_POSIX_SIGNALBLOCKING@ |
# if !@HAVE_POSIX_SIGNALBLOCKING@ |
|
|
|
# ifndef GNULIB_defined_signal_blocking |
|
# define GNULIB_defined_signal_blocking 1 |
|
# endif |
|
|
/* Maximum signal number + 1. */ |
/* Maximum signal number + 1. */ |
# ifndef NSIG |
# ifndef NSIG |
# define NSIG 32 |
# define NSIG 32 |
Line 168 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1
|
Line 197 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1
|
|
|
# endif |
# endif |
|
|
|
/* When also using extern inline, suppress the use of static inline in |
|
standard headers of problematic Apple configurations, as Libc at |
|
least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., |
|
<https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>. |
|
Perhaps Apple will fix this some day. */ |
|
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ |
|
&& (defined __i386__ || defined __x86_64__)) |
|
# undef sigaddset |
|
# undef sigdelset |
|
# undef sigemptyset |
|
# undef sigfillset |
|
# undef sigismember |
|
#endif |
|
|
/* Test whether a given signal is contained in a signal set. */ |
/* Test whether a given signal is contained in a signal set. */ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
/* This function is defined as a macro on MacOS X. */ | /* This function is defined as a macro on Mac OS X. */ |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# undef sigismember |
# undef sigismember |
# endif |
# endif |
Line 183 _GL_CXXALIASWARN (sigismember);
|
Line 226 _GL_CXXALIASWARN (sigismember);
|
|
|
/* Initialize a signal set to the empty set. */ |
/* Initialize a signal set to the empty set. */ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
/* This function is defined as a macro on MacOS X. */ | /* This function is defined as a macro on Mac OS X. */ |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# undef sigemptyset |
# undef sigemptyset |
# endif |
# endif |
Line 195 _GL_CXXALIASWARN (sigemptyset);
|
Line 238 _GL_CXXALIASWARN (sigemptyset);
|
|
|
/* Add a signal to a signal set. */ |
/* Add a signal to a signal set. */ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
/* This function is defined as a macro on MacOS X. */ | /* This function is defined as a macro on Mac OS X. */ |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# undef sigaddset |
# undef sigaddset |
# endif |
# endif |
Line 208 _GL_CXXALIASWARN (sigaddset);
|
Line 251 _GL_CXXALIASWARN (sigaddset);
|
|
|
/* Remove a signal from a signal set. */ |
/* Remove a signal from a signal set. */ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
/* This function is defined as a macro on MacOS X. */ | /* This function is defined as a macro on Mac OS X. */ |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# undef sigdelset |
# undef sigdelset |
# endif |
# endif |
Line 221 _GL_CXXALIASWARN (sigdelset);
|
Line 264 _GL_CXXALIASWARN (sigdelset);
|
|
|
/* Fill a signal set with all possible signals. */ |
/* Fill a signal set with all possible signals. */ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
# if @HAVE_POSIX_SIGNALBLOCKING@ |
/* This function is defined as a macro on MacOS X. */ | /* This function is defined as a macro on Mac OS X. */ |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# if defined __cplusplus && defined GNULIB_NAMESPACE |
# undef sigfillset |
# undef sigfillset |
# endif |
# endif |
Line 280 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_retu
|
Line 323 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_retu
|
# endif |
# endif |
_GL_CXXALIASWARN (signal); |
_GL_CXXALIASWARN (signal); |
|
|
/* Raise signal SIG. */ |
|
# if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE |
# if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) | /* Raise signal SIGPIPE. */ |
# undef raise | _GL_EXTERN_C int _gl_raise_SIGPIPE (void); |
# define raise rpl_raise | |
# endif | |
_GL_FUNCDECL_RPL (raise, int, (int sig)); | |
_GL_CXXALIAS_RPL (raise, int, (int sig)); | |
# else | |
_GL_CXXALIAS_SYS (raise, int, (int sig)); | |
# endif |
# endif |
_GL_CXXALIASWARN (raise); |
|
|
|
#elif defined GNULIB_POSIXCHECK |
#elif defined GNULIB_POSIXCHECK |
# undef sigaddset |
# undef sigaddset |