gdb-sigmask.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* sigprocmask wrapper for gdb
  2. Copyright (C) 2019-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef GDBSUPPORT_GDB_SIGMASK_H
  15. #define GDBSUPPORT_GDB_SIGMASK_H
  16. #include <signal.h>
  17. #ifdef HAVE_SIGPROCMASK
  18. #ifdef HAVE_PTHREAD_SIGMASK
  19. #define gdb_sigmask pthread_sigmask
  20. #else
  21. #define gdb_sigmask sigprocmask
  22. #endif
  23. #else /* HAVE_SIGPROCMASK */
  24. /* Other code checks HAVE_SIGPROCMASK, but if there happened to be a
  25. system that only had pthread_sigmask, we could still use it with
  26. some extra changes. */
  27. #ifdef HAVE_PTHREAD_SIGMASK
  28. #error pthread_sigmask available without sigprocmask - please report
  29. #endif
  30. #endif /* HAVE_SIGPROCMASK */
  31. #endif /* GDBSUPPORT_GDB_SIGMASK_H */