Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Fixes: debbugs:13026
2012-12-08 02:30:51 +00:00
|
|
|
/* sig2str.c -- convert between signal names and numbers
|
|
|
|
|
2016-01-01 09:12:52 +00:00
|
|
|
Copyright (C) 2002, 2004, 2006, 2009-2016 Free Software Foundation, Inc.
|
Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Fixes: debbugs:13026
2012-12-08 02:30:51 +00:00
|
|
|
|
|
|
|
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 <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
/* Written by Paul Eggert. */
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include <limits.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "sig2str.h"
|
|
|
|
|
|
|
|
#ifndef SIGRTMIN
|
|
|
|
# define SIGRTMIN 0
|
|
|
|
# undef SIGRTMAX
|
|
|
|
#endif
|
|
|
|
#ifndef SIGRTMAX
|
|
|
|
# define SIGRTMAX (SIGRTMIN - 1)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define NUMNAME(name) { SIG##name, #name }
|
|
|
|
|
|
|
|
/* Signal names and numbers. Put the preferred name first. */
|
|
|
|
static struct numname { int num; char const name[8]; } numname_table[] =
|
|
|
|
{
|
|
|
|
/* Signals required by POSIX 1003.1-2001 base, listed in
|
|
|
|
traditional numeric order where possible. */
|
|
|
|
#ifdef SIGHUP
|
|
|
|
NUMNAME (HUP),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGINT
|
|
|
|
NUMNAME (INT),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGQUIT
|
|
|
|
NUMNAME (QUIT),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGILL
|
|
|
|
NUMNAME (ILL),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGTRAP
|
|
|
|
NUMNAME (TRAP),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGABRT
|
|
|
|
NUMNAME (ABRT),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGFPE
|
|
|
|
NUMNAME (FPE),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGKILL
|
|
|
|
NUMNAME (KILL),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGSEGV
|
|
|
|
NUMNAME (SEGV),
|
|
|
|
#endif
|
|
|
|
/* On Haiku, SIGSEGV == SIGBUS, but we prefer SIGSEGV to match
|
|
|
|
strsignal.c output, so SIGBUS must be listed second. */
|
|
|
|
#ifdef SIGBUS
|
|
|
|
NUMNAME (BUS),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGPIPE
|
|
|
|
NUMNAME (PIPE),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGALRM
|
|
|
|
NUMNAME (ALRM),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGTERM
|
|
|
|
NUMNAME (TERM),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGUSR1
|
|
|
|
NUMNAME (USR1),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGUSR2
|
|
|
|
NUMNAME (USR2),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGCHLD
|
|
|
|
NUMNAME (CHLD),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGURG
|
|
|
|
NUMNAME (URG),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGSTOP
|
|
|
|
NUMNAME (STOP),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGTSTP
|
|
|
|
NUMNAME (TSTP),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGCONT
|
|
|
|
NUMNAME (CONT),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGTTIN
|
|
|
|
NUMNAME (TTIN),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGTTOU
|
|
|
|
NUMNAME (TTOU),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Signals required by POSIX 1003.1-2001 with the XSI extension. */
|
|
|
|
#ifdef SIGSYS
|
|
|
|
NUMNAME (SYS),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGPOLL
|
|
|
|
NUMNAME (POLL),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGVTALRM
|
|
|
|
NUMNAME (VTALRM),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGPROF
|
|
|
|
NUMNAME (PROF),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGXCPU
|
|
|
|
NUMNAME (XCPU),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGXFSZ
|
|
|
|
NUMNAME (XFSZ),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Unix Version 7. */
|
|
|
|
#ifdef SIGIOT
|
|
|
|
NUMNAME (IOT), /* Older name for ABRT. */
|
|
|
|
#endif
|
|
|
|
#ifdef SIGEMT
|
|
|
|
NUMNAME (EMT),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* USG Unix. */
|
|
|
|
#ifdef SIGPHONE
|
|
|
|
NUMNAME (PHONE),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGWIND
|
|
|
|
NUMNAME (WIND),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Unix System V. */
|
|
|
|
#ifdef SIGCLD
|
|
|
|
NUMNAME (CLD),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGPWR
|
|
|
|
NUMNAME (PWR),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* GNU/Linux 2.2 and Solaris 8. */
|
|
|
|
#ifdef SIGCANCEL
|
|
|
|
NUMNAME (CANCEL),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGLWP
|
|
|
|
NUMNAME (LWP),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGWAITING
|
|
|
|
NUMNAME (WAITING),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGFREEZE
|
|
|
|
NUMNAME (FREEZE),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGTHAW
|
|
|
|
NUMNAME (THAW),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGLOST
|
|
|
|
NUMNAME (LOST),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGWINCH
|
|
|
|
NUMNAME (WINCH),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* GNU/Linux 2.2. */
|
|
|
|
#ifdef SIGINFO
|
|
|
|
NUMNAME (INFO),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGIO
|
|
|
|
NUMNAME (IO),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGSTKFLT
|
|
|
|
NUMNAME (STKFLT),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* AIX 5L. */
|
|
|
|
#ifdef SIGDANGER
|
|
|
|
NUMNAME (DANGER),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGGRANT
|
|
|
|
NUMNAME (GRANT),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGMIGRATE
|
|
|
|
NUMNAME (MIGRATE),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGMSG
|
|
|
|
NUMNAME (MSG),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGPRE
|
|
|
|
NUMNAME (PRE),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGRETRACT
|
|
|
|
NUMNAME (RETRACT),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGSAK
|
|
|
|
NUMNAME (SAK),
|
|
|
|
#endif
|
|
|
|
#ifdef SIGSOUND
|
|
|
|
NUMNAME (SOUND),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Older AIX versions. */
|
|
|
|
#ifdef SIGALRM1
|
|
|
|
NUMNAME (ALRM1), /* unknown; taken from Bash 2.05 */
|
|
|
|
#endif
|
|
|
|
#ifdef SIGKAP
|
|
|
|
NUMNAME (KAP), /* Older name for SIGGRANT. */
|
|
|
|
#endif
|
|
|
|
#ifdef SIGVIRT
|
|
|
|
NUMNAME (VIRT), /* unknown; taken from Bash 2.05 */
|
|
|
|
#endif
|
|
|
|
#ifdef SIGWINDOW
|
|
|
|
NUMNAME (WINDOW), /* Older name for SIGWINCH. */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* BeOS */
|
|
|
|
#ifdef SIGKILLTHR
|
|
|
|
NUMNAME (KILLTHR),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Older HP-UX versions. */
|
|
|
|
#ifdef SIGDIL
|
|
|
|
NUMNAME (DIL),
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Korn shell and Bash, of uncertain vintage. */
|
|
|
|
{ 0, "EXIT" }
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NUMNAME_ENTRIES (sizeof numname_table / sizeof numname_table[0])
|
|
|
|
|
|
|
|
/* ISDIGIT differs from isdigit, as follows:
|
|
|
|
- Its arg may be any int or unsigned int; it need not be an unsigned char
|
|
|
|
or EOF.
|
|
|
|
- It's typically faster.
|
|
|
|
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
|
|
|
|
isdigit unless it's important to use the locale's definition
|
|
|
|
of "digit" even when the host does not conform to POSIX. */
|
|
|
|
#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
|
|
|
|
|
|
|
|
/* Convert the signal name SIGNAME to a signal number. Return the
|
|
|
|
signal number if successful, -1 otherwise. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
str2signum (char const *signame)
|
|
|
|
{
|
|
|
|
if (ISDIGIT (*signame))
|
|
|
|
{
|
|
|
|
char *endp;
|
|
|
|
long int n = strtol (signame, &endp, 10);
|
|
|
|
if (! *endp && n <= SIGNUM_BOUND)
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < NUMNAME_ENTRIES; i++)
|
|
|
|
if (strcmp (numname_table[i].name, signame) == 0)
|
|
|
|
return numname_table[i].num;
|
|
|
|
|
|
|
|
{
|
|
|
|
char *endp;
|
|
|
|
int rtmin = SIGRTMIN;
|
|
|
|
int rtmax = SIGRTMAX;
|
|
|
|
|
|
|
|
if (0 < rtmin && strncmp (signame, "RTMIN", 5) == 0)
|
|
|
|
{
|
|
|
|
long int n = strtol (signame + 5, &endp, 10);
|
|
|
|
if (! *endp && 0 <= n && n <= rtmax - rtmin)
|
|
|
|
return rtmin + n;
|
|
|
|
}
|
|
|
|
else if (0 < rtmax && strncmp (signame, "RTMAX", 5) == 0)
|
|
|
|
{
|
|
|
|
long int n = strtol (signame + 5, &endp, 10);
|
|
|
|
if (! *endp && rtmin - rtmax <= n && n <= 0)
|
|
|
|
return rtmax + n;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert the signal name SIGNAME to the signal number *SIGNUM.
|
|
|
|
Return 0 if successful, -1 otherwise. */
|
|
|
|
|
|
|
|
int
|
|
|
|
str2sig (char const *signame, int *signum)
|
|
|
|
{
|
|
|
|
*signum = str2signum (signame);
|
|
|
|
return *signum < 0 ? -1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert SIGNUM to a signal name in SIGNAME. SIGNAME must point to
|
|
|
|
a buffer of at least SIG2STR_MAX bytes. Return 0 if successful, -1
|
|
|
|
otherwise. */
|
|
|
|
|
|
|
|
int
|
|
|
|
sig2str (int signum, char *signame)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < NUMNAME_ENTRIES; i++)
|
|
|
|
if (numname_table[i].num == signum)
|
|
|
|
{
|
|
|
|
strcpy (signame, numname_table[i].name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
int rtmin = SIGRTMIN;
|
|
|
|
int rtmax = SIGRTMAX;
|
2013-05-16 07:10:39 +00:00
|
|
|
int base, delta;
|
Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Fixes: debbugs:13026
2012-12-08 02:30:51 +00:00
|
|
|
|
|
|
|
if (! (rtmin <= signum && signum <= rtmax))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (signum <= rtmin + (rtmax - rtmin) / 2)
|
|
|
|
{
|
2013-05-16 07:10:39 +00:00
|
|
|
strcpy (signame, "RTMIN");
|
|
|
|
base = rtmin;
|
Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Fixes: debbugs:13026
2012-12-08 02:30:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-05-16 07:10:39 +00:00
|
|
|
strcpy (signame, "RTMAX");
|
|
|
|
base = rtmax;
|
Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Fixes: debbugs:13026
2012-12-08 02:30:51 +00:00
|
|
|
}
|
|
|
|
|
2013-05-16 07:10:39 +00:00
|
|
|
delta = signum - base;
|
|
|
|
if (delta != 0)
|
|
|
|
sprintf (signame + 5, "%+d", delta);
|
Assume POSIX 1003.1-1988 or later for signal.h.
Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
* admin/CPP-DEFINES (SIGALRM, SIGCHLD, SIGHUP, SIGKILL, SIGPIPE, SIGQUIT):
Remove.
(SIGTRAP): Remove this one too, as config.h no longer defines it.
* admin/merge-gnulib (GNULIB_MODULES): Add sig2str.
* configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
Use SIGCHLD rather than SIGCLD.
* lib/sig2str.c, lib/sig2str.h, m4/sig2str.m4: New files, from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/makefile.w32-in (GNULIBOBJS): Add $(BUILD)/sig2str.$(O).
* src/process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
(deleted_pid_list, Fdelete_process, create_process)
(record_child_status_change, handle_child_signal, deliver_child_signal)
(init_process_emacs, syms_of_process):
Assume SIGCHLD is defined.
(parse_signal): Remove. All uses removed.
(abbr_to_signal): New static function.
(Fsignal_process): Use it to convert signal names to ints.
* src/sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
kill (getpgrp (), ...).
(emacs_sigaction_init): Assume SIGCHLD is defined.
(init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
* src/syssignal.h (EMACS_KILLPG): Remove.
All uses replaced by 'kill' with a negative pid.
(SIGCHLD): Remove definition, as we now assume SIGCHLD.
* src/w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
Fixes: debbugs:13026
2012-12-08 02:30:51 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|