allocrtsig.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Handle real-time signal allocation. NPTL version.
  2. Copyright (C) 2015-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library 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 GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include <signal.h>
  16. #include <nptl/pthreadP.h>
  17. /* Up to three special signals might be used privately by libpthread.
  18. Figure out how many unique ones are actually used. */
  19. #ifdef SIGCANCEL
  20. # define SIGCANCEL_CONSUMES 1
  21. #else
  22. # define SIGCANCEL_CONSUMES 0
  23. #endif
  24. #if defined SIGTIMER && (!defined SIGCANCEL || SIGTIMER != SIGCANCEL)
  25. # define SIGTIMER_CONSUMES 1
  26. #else
  27. # define SIGTIMER_CONSUMES 0
  28. #endif
  29. #if (defined SIGSETXID \
  30. && (!defined SIGCANCEL || SIGSETXID != SIGCANCEL) \
  31. && (!defined SIGTIMER || SIGSETXID != SIGTIMER))
  32. # define SIGSETXID_CONSUMES 1
  33. #else
  34. # define SIGSETXID_CONSUMES 0
  35. #endif
  36. /* This tells the generic code (included below) how many signal
  37. numbers need to be reserved for libpthread's private uses. */
  38. #define RESERVED_SIGRT \
  39. (SIGCANCEL_CONSUMES + SIGTIMER_CONSUMES + SIGSETXID_CONSUMES)
  40. #include <signal/allocrtsig.c>