logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git

sys_signame.h (779B)


  1. // utils-std: Collection of commonly available Unix tools
  2. // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. // SPDX-License-Identifier: CC0-1.0 OR WTFPL
  4. #ifndef _DEFAULT_SOURCE
  5. #define _DEFAULT_SOURCE // NSIG
  6. #endif
  7. #include <signal.h> // NSIG
  8. // POSIX defect 741 (applied in issue 8 draft 4.1) adds _SC_NSIG
  9. // https://www.austingroupbugs.net/view.php?id=741
  10. // But it isn't implemented in current (musl 1.2.5, glibc 2.38) systems,
  11. // so I'm keeping it this way for now.
  12. #ifndef NSIG
  13. #if defined(SIGMAX)
  14. #define NSIG (SIGMAX + 1)
  15. #else
  16. #warning NSIG nor SIGMAX were defined, this might be a bug.
  17. #define NSIG (8 * sizeof(sigset_t) + 1)
  18. #endif
  19. #endif
  20. extern const char *util_sys_signame[NSIG];
  21. static size_t util_sys_signame_len = NSIG;