17d62b00eSchristos /* sigprocmask wrapper for gdb 27d62b00eSchristos 3*6881a400Schristos Copyright (C) 2019-2023 Free Software Foundation, Inc. 47d62b00eSchristos 57d62b00eSchristos This file is part of GDB. 67d62b00eSchristos 77d62b00eSchristos This program is free software; you can redistribute it and/or modify 87d62b00eSchristos it under the terms of the GNU General Public License as published by 97d62b00eSchristos the Free Software Foundation; either version 3 of the License, or 107d62b00eSchristos (at your option) any later version. 117d62b00eSchristos 127d62b00eSchristos This program is distributed in the hope that it will be useful, 137d62b00eSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 147d62b00eSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 157d62b00eSchristos GNU General Public License for more details. 167d62b00eSchristos 177d62b00eSchristos You should have received a copy of the GNU General Public License 187d62b00eSchristos along with this program. If not, see <http://www.gnu.org/licenses/>. */ 197d62b00eSchristos 207d62b00eSchristos #ifndef GDBSUPPORT_GDB_SIGMASK_H 217d62b00eSchristos #define GDBSUPPORT_GDB_SIGMASK_H 227d62b00eSchristos 237d62b00eSchristos #include <signal.h> 247d62b00eSchristos 257d62b00eSchristos #ifdef HAVE_SIGPROCMASK 267d62b00eSchristos 277d62b00eSchristos #ifdef HAVE_PTHREAD_SIGMASK 287d62b00eSchristos #define gdb_sigmask pthread_sigmask 297d62b00eSchristos #else 307d62b00eSchristos #define gdb_sigmask sigprocmask 317d62b00eSchristos #endif 327d62b00eSchristos 337d62b00eSchristos #else /* HAVE_SIGPROCMASK */ 347d62b00eSchristos 357d62b00eSchristos /* Other code checks HAVE_SIGPROCMASK, but if there happened to be a 367d62b00eSchristos system that only had pthread_sigmask, we could still use it with 377d62b00eSchristos some extra changes. */ 387d62b00eSchristos #ifdef HAVE_PTHREAD_SIGMASK 397d62b00eSchristos #error pthread_sigmask available without sigprocmask - please report 407d62b00eSchristos #endif 417d62b00eSchristos 427d62b00eSchristos #endif /* HAVE_SIGPROCMASK */ 437d62b00eSchristos 447d62b00eSchristos 457d62b00eSchristos #endif /* GDBSUPPORT_GDB_SIGMASK_H */ 46