sigaction.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* The proper definitions for Linux/SPARC sigaction.
  2. Copyright (C) 1996-2017 Free Software Foundation, Inc.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _SIGNAL_H
  15. # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
  16. #endif
  17. /* Structure describing the action to be taken when a signal arrives. */
  18. struct sigaction
  19. {
  20. /* Signal handler. */
  21. #ifdef __USE_POSIX199309
  22. union
  23. {
  24. /* Used if SA_SIGINFO is not set. */
  25. __sighandler_t sa_handler;
  26. /* Used if SA_SIGINFO is set. */
  27. void (*sa_sigaction) (int, siginfo_t *, void *);
  28. }
  29. __sigaction_handler;
  30. # define sa_handler __sigaction_handler.sa_handler
  31. # define sa_sigaction __sigaction_handler.sa_sigaction
  32. #else
  33. __sighandler_t sa_handler;
  34. #endif
  35. /* Additional set of signals to be blocked. */
  36. __sigset_t sa_mask;
  37. /* Special flags. */
  38. int __glibc_reserved0;
  39. int sa_flags;
  40. /* Not used by Linux/Sparc yet. */
  41. void (*sa_restorer) (void);
  42. };
  43. /* Bits in `sa_flags'. */
  44. #define SA_NOCLDSTOP 0x00000008 /* Don't send SIGCHLD when children stop. */
  45. #define SA_NOCLDWAIT 0x00000100 /* Don't create zombie on child death. */
  46. #define SA_SIGINFO 0x00000200 /* Invoke signal-catching function with
  47. three arguments instead of one. */
  48. #if defined __USE_UNIX98 || defined __USE_MISC
  49. # define SA_ONSTACK 0x00000001 /* Use signal stack by using `sa_restorer'. */
  50. #endif
  51. #if defined __USE_UNIX98 || defined __USE_XOPEN2K8
  52. # define SA_RESTART 0x00000002 /* Restart syscall on signal return. */
  53. # define SA_INTERRUPT 0x00000010 /* Historical no-op. */
  54. # define SA_NOMASK 0x00000020 /* Don't automatically block the signal when
  55. its handler is being executed. */
  56. # define SA_ONESHOT 0x00000004 /* Reset to SIG_DFL on entry to handler. */
  57. /* Some aliases for the SA_ constants. */
  58. # define SA_NODEFER SA_NOMASK
  59. # define SA_RESETHAND SA_ONESHOT
  60. # define SA_STACK SA_ONSTACK
  61. #endif
  62. /* Values for the HOW argument to `sigprocmask'. */
  63. #define SIG_BLOCK 1 /* Block signals. */
  64. #define SIG_UNBLOCK 2 /* Unblock signals. */
  65. #define SIG_SETMASK 4 /* Set the set of blocked signals. */