GDBserver
signal.h
Go to the documentation of this file.
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2 /* A GNU-like <signal.h>.
3 
4  Copyright (C) 2006-2016 Free Software Foundation, Inc.
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 
19 #if __GNUC__ >= 3
20 #pragma GCC system_header
21 #endif
22 
23 
24 #if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
25 /* Special invocation convention:
26  - Inside glibc header files.
27  - On glibc systems we have a sequence of nested includes
28  <signal.h> -> <ucontext.h> -> <signal.h>.
29  In this situation, the functions are not yet declared, therefore we cannot
30  provide the C++ aliases.
31  - On glibc systems with GCC 4.3 we have a sequence of nested includes
32  <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
33  In this situation, some of the functions are not yet declared, therefore
34  we cannot provide the C++ aliases. */
35 
36 # include_next <signal.h>
37 
38 #else
39 /* Normal invocation convention. */
40 
41 #ifndef _GL_SIGNAL_H
42 
43 #define _GL_ALREADY_INCLUDING_SIGNAL_H
44 
45 /* Define pid_t, uid_t.
46  Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
47  On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
48  us; so include <sys/types.h> now, before the second inclusion guard. */
49 #include <sys/types.h>
50 
51 /* The include_next requires a split double-inclusion guard. */
52 #include_next <signal.h>
53 
54 #undef _GL_ALREADY_INCLUDING_SIGNAL_H
55 
56 #ifndef _GL_SIGNAL_H
57 #define _GL_SIGNAL_H
58 
59 /* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android
60  declare pthread_sigmask in <pthread.h>, not in <signal.h>.
61  But avoid namespace pollution on glibc systems.*/
62 #if (0 || defined GNULIB_POSIXCHECK) \
63  && ((defined __APPLE__ && defined __MACH__) \
64  || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
65  || defined __sun || defined __ANDROID__) \
66  && ! defined __GLIBC__
67 # include <pthread.h>
68 #endif
69 
70 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
71 #ifndef _GL_CXXDEFS_H
72 #define _GL_CXXDEFS_H
73 
74 /* Begin/end the GNULIB_NAMESPACE namespace. */
75 #if defined __cplusplus && defined GNULIB_NAMESPACE
76 # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
77 # define _GL_END_NAMESPACE }
78 #else
79 # define _GL_BEGIN_NAMESPACE
80 # define _GL_END_NAMESPACE
81 #endif
82 
83 /* The three most frequent use cases of these macros are:
84 
85  * For providing a substitute for a function that is missing on some
86  platforms, but is declared and works fine on the platforms on which
87  it exists:
88 
89  #if @GNULIB_FOO@
90  # if !@HAVE_FOO@
91  _GL_FUNCDECL_SYS (foo, ...);
92  # endif
93  _GL_CXXALIAS_SYS (foo, ...);
94  _GL_CXXALIASWARN (foo);
95  #elif defined GNULIB_POSIXCHECK
96  ...
97  #endif
98 
99  * For providing a replacement for a function that exists on all platforms,
100  but is broken/insufficient and needs to be replaced on some platforms:
101 
102  #if @GNULIB_FOO@
103  # if @REPLACE_FOO@
104  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
105  # undef foo
106  # define foo rpl_foo
107  # endif
108  _GL_FUNCDECL_RPL (foo, ...);
109  _GL_CXXALIAS_RPL (foo, ...);
110  # else
111  _GL_CXXALIAS_SYS (foo, ...);
112  # endif
113  _GL_CXXALIASWARN (foo);
114  #elif defined GNULIB_POSIXCHECK
115  ...
116  #endif
117 
118  * For providing a replacement for a function that exists on some platforms
119  but is broken/insufficient and needs to be replaced on some of them and
120  is additionally either missing or undeclared on some other platforms:
121 
122  #if @GNULIB_FOO@
123  # if @REPLACE_FOO@
124  # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
125  # undef foo
126  # define foo rpl_foo
127  # endif
128  _GL_FUNCDECL_RPL (foo, ...);
129  _GL_CXXALIAS_RPL (foo, ...);
130  # else
131  # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
132  _GL_FUNCDECL_SYS (foo, ...);
133  # endif
134  _GL_CXXALIAS_SYS (foo, ...);
135  # endif
136  _GL_CXXALIASWARN (foo);
137  #elif defined GNULIB_POSIXCHECK
138  ...
139  #endif
140 */
141 
142 /* _GL_EXTERN_C declaration;
143  performs the declaration with C linkage. */
144 #if defined __cplusplus
145 # define _GL_EXTERN_C extern "C"
146 #else
147 # define _GL_EXTERN_C extern
148 #endif
149 
150 /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
151  declares a replacement function, named rpl_func, with the given prototype,
152  consisting of return type, parameters, and attributes.
153  Example:
154  _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
155  _GL_ARG_NONNULL ((1)));
156  */
157 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
158  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
159 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
160  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
161 
162 /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
163  declares the system function, named func, with the given prototype,
164  consisting of return type, parameters, and attributes.
165  Example:
166  _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
167  _GL_ARG_NONNULL ((1)));
168  */
169 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
170  _GL_EXTERN_C rettype func parameters_and_attributes
171 
172 /* _GL_CXXALIAS_RPL (func, rettype, parameters);
173  declares a C++ alias called GNULIB_NAMESPACE::func
174  that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
175  Example:
176  _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
177 
178  Wrapping rpl_func in an object with an inline conversion operator
179  avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
180  actually used in the program. */
181 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
182  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
183 #if defined __cplusplus && defined GNULIB_NAMESPACE
184 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
185  namespace GNULIB_NAMESPACE \
186  { \
187  static const struct _gl_ ## func ## _wrapper \
188  { \
189  typedef rettype (*type) parameters; \
190  inline type rpl () const { return ::rpl_func; } \
191  inline operator type () const { return rpl (); } \
192  } func = {}; \
193  } \
194  _GL_EXTERN_C int _gl_cxxalias_dummy
195 #else
196 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
197  _GL_EXTERN_C int _gl_cxxalias_dummy
198 #endif
199 
200 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
201  is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
202  except that the C function rpl_func may have a slightly different
203  declaration. A cast is used to silence the "invalid conversion" error
204  that would otherwise occur. */
205 #if defined __cplusplus && defined GNULIB_NAMESPACE
206 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
207  namespace GNULIB_NAMESPACE \
208  { \
209  static const struct _gl_ ## func ## _wrapper \
210  { \
211  typedef rettype (*type) parameters; \
212  inline type rpl () const \
213  { return reinterpret_cast<type>(::rpl_func); } \
214  inline operator type () const { return rpl (); } \
215  } func = {}; \
216  } \
217  _GL_EXTERN_C int _gl_cxxalias_dummy
218 #else
219 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
220  _GL_EXTERN_C int _gl_cxxalias_dummy
221 #endif
222 
223 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
224  declares a C++ alias called GNULIB_NAMESPACE::func
225  that redirects to the system provided function func, if GNULIB_NAMESPACE
226  is defined.
227  Example:
228  _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
229 
230  Wrapping func in an object with an inline conversion operator
231  avoids a reference to func unless GNULIB_NAMESPACE::func is
232  actually used in the program. */
233 #if defined __cplusplus && defined GNULIB_NAMESPACE
234 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
235  namespace GNULIB_NAMESPACE \
236  { \
237  static const struct _gl_ ## func ## _wrapper \
238  { \
239  typedef rettype (*type) parameters; \
240  inline type rpl () const { return ::func; } \
241  inline operator type () const { return rpl (); } \
242  } func = {}; \
243  } \
244  _GL_EXTERN_C int _gl_cxxalias_dummy
245 #else
246 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
247  _GL_EXTERN_C int _gl_cxxalias_dummy
248 #endif
249 
250 /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
251  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
252  except that the C function func may have a slightly different declaration.
253  A cast is used to silence the "invalid conversion" error that would
254  otherwise occur. */
255 #if defined __cplusplus && defined GNULIB_NAMESPACE
256 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
257  namespace GNULIB_NAMESPACE \
258  { \
259  static const struct _gl_ ## func ## _wrapper \
260  { \
261  typedef rettype (*type) parameters; \
262  inline type rpl () const \
263  { return reinterpret_cast<type>(::func); } \
264  inline operator type () const { return rpl (); }\
265  } func = {}; \
266  } \
267  _GL_EXTERN_C int _gl_cxxalias_dummy
268 #else
269 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
270  _GL_EXTERN_C int _gl_cxxalias_dummy
271 #endif
272 
273 /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
274  is like _GL_CXXALIAS_SYS (func, rettype, parameters);
275  except that the C function is picked among a set of overloaded functions,
276  namely the one with rettype2 and parameters2. Two consecutive casts
277  are used to silence the "cannot find a match" and "invalid conversion"
278  errors that would otherwise occur. */
279 #if defined __cplusplus && defined GNULIB_NAMESPACE
280  /* The outer cast must be a reinterpret_cast.
281  The inner cast: When the function is defined as a set of overloaded
282  functions, it works as a static_cast<>, choosing the designated variant.
283  When the function is defined as a single variant, it works as a
284  reinterpret_cast<>. The parenthesized cast syntax works both ways. */
285 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
286  namespace GNULIB_NAMESPACE \
287  { \
288  static const struct _gl_ ## func ## _wrapper \
289  { \
290  typedef rettype (*type) parameters; \
291  \
292  inline type rpl () const \
293  { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\
294  \
295  inline operator type () const { return rpl (); } \
296  } func = {}; \
297  } \
298  _GL_EXTERN_C int _gl_cxxalias_dummy
299 #else
300 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
301  _GL_EXTERN_C int _gl_cxxalias_dummy
302 #endif
303 
304 /* _GL_CXXALIASWARN (func);
305  causes a warning to be emitted when ::func is used but not when
306  GNULIB_NAMESPACE::func is used. func must be defined without overloaded
307  variants. */
308 #if defined __cplusplus && defined GNULIB_NAMESPACE
309 # define _GL_CXXALIASWARN(func) \
310  _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
311 # define _GL_CXXALIASWARN_1(func,namespace) \
312  _GL_CXXALIASWARN_2 (func, namespace)
313 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
314  we enable the warning only when not optimizing. */
315 # if !__OPTIMIZE__
316 # define _GL_CXXALIASWARN_2(func,namespace) \
317  _GL_WARN_ON_USE (func, \
318  "The symbol ::" #func " refers to the system function. " \
319  "Use " #namespace "::" #func " instead.")
320 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
321 # define _GL_CXXALIASWARN_2(func,namespace) \
322  extern __typeof__ (func) func
323 # else
324 # define _GL_CXXALIASWARN_2(func,namespace) \
325  _GL_EXTERN_C int _gl_cxxalias_dummy
326 # endif
327 #else
328 # define _GL_CXXALIASWARN(func) \
329  _GL_EXTERN_C int _gl_cxxalias_dummy
330 #endif
331 
332 /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
333  causes a warning to be emitted when the given overloaded variant of ::func
334  is used but not when GNULIB_NAMESPACE::func is used. */
335 #if defined __cplusplus && defined GNULIB_NAMESPACE
336 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
337  _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
338  GNULIB_NAMESPACE)
339 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
340  _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
341 /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
342  we enable the warning only when not optimizing. */
343 # if !__OPTIMIZE__
344 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
345  _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
346  "The symbol ::" #func " refers to the system function. " \
347  "Use " #namespace "::" #func " instead.")
348 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
349 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
350  extern __typeof__ (func) func
351 # else
352 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
353  _GL_EXTERN_C int _gl_cxxalias_dummy
354 # endif
355 #else
356 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
357  _GL_EXTERN_C int _gl_cxxalias_dummy
358 #endif
359 
360 #endif /* _GL_CXXDEFS_H */
361 
362 /* The definition of _GL_ARG_NONNULL is copied here. */
363 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
364  that the values passed as arguments n, ..., m must be non-NULL pointers.
365  n = 1 stands for the first argument, n = 2 for the second argument etc. */
366 #ifndef _GL_ARG_NONNULL
367 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
368 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
369 # else
370 # define _GL_ARG_NONNULL(params)
371 # endif
372 #endif
373 
374 /* The definition of _GL_WARN_ON_USE is copied here. */
375 #ifndef _GL_WARN_ON_USE
376 
377 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
378 /* A compiler attribute is available in gcc versions 4.3.0 and later. */
379 # define _GL_WARN_ON_USE(function, message) \
380 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
381 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
382 /* Verify the existence of the function. */
383 # define _GL_WARN_ON_USE(function, message) \
384 extern __typeof__ (function) function
385 # else /* Unsupported. */
386 # define _GL_WARN_ON_USE(function, message) \
387 _GL_WARN_EXTERN_C int _gl_warn_on_use
388 # endif
389 #endif
390 
391 /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
392  is like _GL_WARN_ON_USE (function, "string"), except that the function is
393  declared with the given prototype, consisting of return type, parameters,
394  and attributes.
395  This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
396  not work in this case. */
397 #ifndef _GL_WARN_ON_USE_CXX
398 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
399 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
400 extern rettype function parameters_and_attributes \
401  __attribute__ ((__warning__ (msg)))
402 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
403 /* Verify the existence of the function. */
404 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
405 extern rettype function parameters_and_attributes
406 # else /* Unsupported. */
407 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
408 _GL_WARN_EXTERN_C int _gl_warn_on_use
409 # endif
410 #endif
411 
412 /* _GL_WARN_EXTERN_C declaration;
413  performs the declaration with C linkage. */
414 #ifndef _GL_WARN_EXTERN_C
415 # if defined __cplusplus
416 # define _GL_WARN_EXTERN_C extern "C"
417 # else
418 # define _GL_WARN_EXTERN_C extern
419 # endif
420 #endif
421 
422 /* On AIX, sig_atomic_t already includes volatile. C99 requires that
423  'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
424  Hence, redefine this to a non-volatile type as needed. */
425 #if ! 1
426 # if !GNULIB_defined_sig_atomic_t
427 typedef int rpl_sig_atomic_t;
428 # undef sig_atomic_t
429 # define sig_atomic_t rpl_sig_atomic_t
430 # define GNULIB_defined_sig_atomic_t 1
431 # endif
432 #endif
433 
434 /* A set or mask of signals. */
435 #if !1
436 # if !GNULIB_defined_sigset_t
437 typedef unsigned int sigset_t;
438 # define GNULIB_defined_sigset_t 1
439 # endif
440 #endif
441 
442 /* Define sighandler_t, the type of signal handlers. A GNU extension. */
443 #if !1
444 # ifdef __cplusplus
445 extern "C" {
446 # endif
447 # if !GNULIB_defined_sighandler_t
448 typedef void (*sighandler_t) (int);
449 # define GNULIB_defined_sighandler_t 1
450 # endif
451 # ifdef __cplusplus
452 }
453 # endif
454 #endif
455 
456 
457 #if 0
458 # ifndef SIGPIPE
459 /* Define SIGPIPE to a value that does not overlap with other signals. */
460 # define SIGPIPE 13
461 # define GNULIB_defined_SIGPIPE 1
462 /* To actually use SIGPIPE, you also need the gnulib modules 'sigprocmask',
463  'write', 'stdio'. */
464 # endif
465 #endif
466 
467 
468 /* Maximum signal number + 1. */
469 #ifndef NSIG
470 # if defined __TANDEM
471 # define NSIG 32
472 # endif
473 #endif
474 
475 
476 #if 0
477 # if 0
478 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
479 # undef pthread_sigmask
480 # define pthread_sigmask rpl_pthread_sigmask
481 # endif
482 _GL_FUNCDECL_RPL (pthread_sigmask, int,
483  (int how, const sigset_t *new_mask, sigset_t *old_mask));
484 _GL_CXXALIAS_RPL (pthread_sigmask, int,
485  (int how, const sigset_t *new_mask, sigset_t *old_mask));
486 # else
487 # if !1
488 _GL_FUNCDECL_SYS (pthread_sigmask, int,
489  (int how, const sigset_t *new_mask, sigset_t *old_mask));
490 # endif
491 _GL_CXXALIAS_SYS (pthread_sigmask, int,
492  (int how, const sigset_t *new_mask, sigset_t *old_mask));
493 # endif
494 _GL_CXXALIASWARN (pthread_sigmask);
495 #elif defined GNULIB_POSIXCHECK
496 # undef pthread_sigmask
497 # if HAVE_RAW_DECL_PTHREAD_SIGMASK
498 _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
499  "use gnulib module pthread_sigmask for portability");
500 # endif
501 #endif
502 
503 
504 #if 0
505 # if 0
506 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
507 # undef raise
508 # define raise rpl_raise
509 # endif
510 _GL_FUNCDECL_RPL (raise, int, (int sig));
511 _GL_CXXALIAS_RPL (raise, int, (int sig));
512 # else
513 # if !1
514 _GL_FUNCDECL_SYS (raise, int, (int sig));
515 # endif
516 _GL_CXXALIAS_SYS (raise, int, (int sig));
517 # endif
518 _GL_CXXALIASWARN (raise);
519 #elif defined GNULIB_POSIXCHECK
520 # undef raise
521 /* Assume raise is always declared. */
522 _GL_WARN_ON_USE (raise, "raise can crash on native Windows - "
523  "use gnulib module raise for portability");
524 #endif
525 
526 
527 #if 0
528 # if !1
529 
530 # ifndef GNULIB_defined_signal_blocking
531 # define GNULIB_defined_signal_blocking 1
532 # endif
533 
534 /* Maximum signal number + 1. */
535 # ifndef NSIG
536 # define NSIG 32
537 # endif
538 
539 /* This code supports only 32 signals. */
540 # if !GNULIB_defined_verify_NSIG_constraint
541 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
542 # define GNULIB_defined_verify_NSIG_constraint 1
543 # endif
544 
545 # endif
546 
547 /* When also using extern inline, suppress the use of static inline in
548  standard headers of problematic Apple configurations, as Libc at
549  least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
550  <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
551  Perhaps Apple will fix this some day. */
552 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
553  && (defined __i386__ || defined __x86_64__))
554 # undef sigaddset
555 # undef sigdelset
556 # undef sigemptyset
557 # undef sigfillset
558 # undef sigismember
559 #endif
560 
561 /* Test whether a given signal is contained in a signal set. */
562 # if 1
563 /* This function is defined as a macro on Mac OS X. */
564 # if defined __cplusplus && defined GNULIB_NAMESPACE
565 # undef sigismember
566 # endif
567 # else
568 _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
569  _GL_ARG_NONNULL ((1)));
570 # endif
571 _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
572 _GL_CXXALIASWARN (sigismember);
573 
574 /* Initialize a signal set to the empty set. */
575 # if 1
576 /* This function is defined as a macro on Mac OS X. */
577 # if defined __cplusplus && defined GNULIB_NAMESPACE
578 # undef sigemptyset
579 # endif
580 # else
581 _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
582 # endif
583 _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
584 _GL_CXXALIASWARN (sigemptyset);
585 
586 /* Add a signal to a signal set. */
587 # if 1
588 /* This function is defined as a macro on Mac OS X. */
589 # if defined __cplusplus && defined GNULIB_NAMESPACE
590 # undef sigaddset
591 # endif
592 # else
593 _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
594  _GL_ARG_NONNULL ((1)));
595 # endif
596 _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
597 _GL_CXXALIASWARN (sigaddset);
598 
599 /* Remove a signal from a signal set. */
600 # if 1
601 /* This function is defined as a macro on Mac OS X. */
602 # if defined __cplusplus && defined GNULIB_NAMESPACE
603 # undef sigdelset
604 # endif
605 # else
606 _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
607  _GL_ARG_NONNULL ((1)));
608 # endif
609 _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
610 _GL_CXXALIASWARN (sigdelset);
611 
612 /* Fill a signal set with all possible signals. */
613 # if 1
614 /* This function is defined as a macro on Mac OS X. */
615 # if defined __cplusplus && defined GNULIB_NAMESPACE
616 # undef sigfillset
617 # endif
618 # else
619 _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
620 # endif
621 _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
622 _GL_CXXALIASWARN (sigfillset);
623 
624 /* Return the set of those blocked signals that are pending. */
625 # if !1
626 _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
627 # endif
628 _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
629 _GL_CXXALIASWARN (sigpending);
630 
631 /* If OLD_SET is not NULL, put the current set of blocked signals in *OLD_SET.
632  Then, if SET is not NULL, affect the current set of blocked signals by
633  combining it with *SET as indicated in OPERATION.
634  In this implementation, you are not allowed to change a signal handler
635  while the signal is blocked. */
636 # if !1
637 # define SIG_BLOCK 0 /* blocked_set = blocked_set | *set; */
638 # define SIG_SETMASK 1 /* blocked_set = *set; */
639 # define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */
640 _GL_FUNCDECL_SYS (sigprocmask, int,
641  (int operation, const sigset_t *set, sigset_t *old_set));
642 # endif
643 _GL_CXXALIAS_SYS (sigprocmask, int,
644  (int operation, const sigset_t *set, sigset_t *old_set));
645 _GL_CXXALIASWARN (sigprocmask);
646 
647 /* Install the handler FUNC for signal SIG, and return the previous
648  handler. */
649 # ifdef __cplusplus
650 extern "C" {
651 # endif
652 # if !GNULIB_defined_function_taking_int_returning_void_t
653 typedef void (*_gl_function_taking_int_returning_void_t) (int);
654 # define GNULIB_defined_function_taking_int_returning_void_t 1
655 # endif
656 # ifdef __cplusplus
657 }
658 # endif
659 # if !1
660 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
661 # define signal rpl_signal
662 # endif
663 _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
664  (int sig, _gl_function_taking_int_returning_void_t func));
665 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
666  (int sig, _gl_function_taking_int_returning_void_t func));
667 # else
668 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
669  (int sig, _gl_function_taking_int_returning_void_t func));
670 # endif
671 _GL_CXXALIASWARN (signal);
672 
673 # if !1 && GNULIB_defined_SIGPIPE
674 /* Raise signal SIGPIPE. */
675 _GL_EXTERN_C int _gl_raise_SIGPIPE (void);
676 # endif
677 
678 #elif defined GNULIB_POSIXCHECK
679 # undef sigaddset
680 # if HAVE_RAW_DECL_SIGADDSET
681 _GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
682  "use the gnulib module sigprocmask for portability");
683 # endif
684 # undef sigdelset
685 # if HAVE_RAW_DECL_SIGDELSET
686 _GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
687  "use the gnulib module sigprocmask for portability");
688 # endif
689 # undef sigemptyset
690 # if HAVE_RAW_DECL_SIGEMPTYSET
691 _GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
692  "use the gnulib module sigprocmask for portability");
693 # endif
694 # undef sigfillset
695 # if HAVE_RAW_DECL_SIGFILLSET
696 _GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
697  "use the gnulib module sigprocmask for portability");
698 # endif
699 # undef sigismember
700 # if HAVE_RAW_DECL_SIGISMEMBER
701 _GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
702  "use the gnulib module sigprocmask for portability");
703 # endif
704 # undef sigpending
705 # if HAVE_RAW_DECL_SIGPENDING
706 _GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
707  "use the gnulib module sigprocmask for portability");
708 # endif
709 # undef sigprocmask
710 # if HAVE_RAW_DECL_SIGPROCMASK
711 _GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
712  "use the gnulib module sigprocmask for portability");
713 # endif
714 #endif /* 0 */
715 
716 
717 #if 0
718 # if !1
719 
720 # if !1
721 
722 # if !GNULIB_defined_siginfo_types
723 
724 /* Present to allow compilation, but unsupported by gnulib. */
725 union sigval
726 {
727  int sival_int;
728  void *sival_ptr;
729 };
730 
731 /* Present to allow compilation, but unsupported by gnulib. */
732 struct siginfo_t
733 {
734  int si_signo;
735  int si_code;
736  int si_errno;
737  pid_t si_pid;
738  uid_t si_uid;
739  void *si_addr;
740  int si_status;
741  long si_band;
742  union sigval si_value;
743 };
744 typedef struct siginfo_t siginfo_t;
745 
746 # define GNULIB_defined_siginfo_types 1
747 # endif
748 
749 # endif /* !1 */
750 
751 /* We assume that platforms which lack the sigaction() function also lack
752  the 'struct sigaction' type, and vice versa. */
753 
754 # if !GNULIB_defined_struct_sigaction
755 
756 struct sigaction
757 {
758  union
759  {
760  void (*_sa_handler) (int);
761  /* Present to allow compilation, but unsupported by gnulib. POSIX
762  says that implementations may, but not must, make sa_sigaction
763  overlap with sa_handler, but we know of no implementation where
764  they do not overlap. */
765  void (*_sa_sigaction) (int, siginfo_t *, void *);
766  } _sa_func;
767  sigset_t sa_mask;
768  /* Not all POSIX flags are supported. */
769  int sa_flags;
770 };
771 # define sa_handler _sa_func._sa_handler
772 # define sa_sigaction _sa_func._sa_sigaction
773 /* Unsupported flags are not present. */
774 # define SA_RESETHAND 1
775 # define SA_NODEFER 2
776 # define SA_RESTART 4
777 
778 # define GNULIB_defined_struct_sigaction 1
779 # endif
780 
781 _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
782  struct sigaction *restrict));
783 
784 # elif !1
785 
786 # define sa_sigaction sa_handler
787 
788 # endif /* !1, !1 */
789 
790 _GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
791  struct sigaction *restrict));
792 _GL_CXXALIASWARN (sigaction);
793 
794 #elif defined GNULIB_POSIXCHECK
795 # undef sigaction
796 # if HAVE_RAW_DECL_SIGACTION
797 _GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
798  "use the gnulib module sigaction for portability");
799 # endif
800 #endif
801 
802 /* Some systems don't have SA_NODEFER. */
803 #ifndef SA_NODEFER
804 # define SA_NODEFER 0
805 #endif
806 
807 
808 #endif /* _GL_SIGNAL_H */
809 #endif /* _GL_SIGNAL_H */
810 #endif
#define _GL_CXXALIAS_SYS(func, rettype, parameters)
Definition: signal.h:246
#define _GL_FUNCDECL_SYS(func, rettype, parameters_and_attributes)
Definition: signal.h:169
#define _GL_WARN_ON_USE(function, message)
Definition: signal.h:386
#define _GL_FUNCDECL_RPL(func, rettype, parameters_and_attributes)
Definition: signal.h:157
#define _GL_ARG_NONNULL(params)
Definition: signal.h:370
#define _GL_CXXALIASWARN(func)
Definition: signal.h:328
#define _GL_EXTERN_C
Definition: signal.h:147
#define _GL_CXXALIAS_RPL(func, rettype, parameters)
Definition: signal.h:181
#define restrict
Definition: config.h:1902