Hash :
94add22a
Author :
Date :
2024-08-09T22:18:16
sig2str: Align with POSIX:2024. * lib/signal.in.h (SIG2STR_MAX): New macro. (sig2str, str2sig): New declarations. * lib/sig2str.h: Don't include intprops.h. (SIG2STR_MAX): Remove macro. (sig2str, str2sig): Remove declarations. * lib/sig2str.c: Include <signal.h> as the specification header. * m4/signal_h.m4 (gl_SIGNAL_H): Test whether sig2str, str2sig are declared. (gl_SIGNAL_H_REQUIRE_DEFAULTS): Initialize GNULIB_SIG2STR. (gl_SIGNAL_H_DEFAULTS): Initialize HAVE_SIG2STR, HAVE_STR2SIG. * m4/sig2str.m4 (gl_FUNC_SIG2STR): Require gl_SIGNAL_H_DEFAULTS. Check also for str2sig. Set HAVE_SIG2STR, HAVE_STR2SIG. * modules/signal-h (Makefile.am): Substitute GNULIB_SIG2STR, HAVE_SIG2STR, HAVE_STR2SIG. * modules/sig2str (Depends-on): Add signal-h. Remove intprops. (configure.ac): Test HAVE_SIG2STR, HAVE_STR2SIG. Invoke gl_SIGNAL_MODULE_INDICATOR. (Include): Add <signal.h>. * doc/posix-functions/sig2str.texi: Mention as implemented through the sig2str module. * doc/posix-functions/str2sig.texi: Likewise.
/* sig2str.h -- convert between signal names and numbers
Copyright (C) 2002, 2005, 2009-2024 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Paul Eggert. */
#include <signal.h>
/* An upper bound on signal numbers allowed by the system. */
#if defined _sys_nsig
# define SIGNUM_BOUND (_sys_nsig - 1)
#elif defined _SIG_MAXSIG
# define SIGNUM_BOUND (_SIG_MAXSIG - 2) /* FreeBSD >= 7. */
#elif defined NSIG
# define SIGNUM_BOUND (NSIG - 1)
#else
# define SIGNUM_BOUND 64
#endif