mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
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
This commit is contained in:
parent
9cdde1e2df
commit
d983a10b9a
18 changed files with 515 additions and 187 deletions
43
lib/sig2str.h
Normal file
43
lib/sig2str.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/* sig2str.h -- convert between signal names and numbers
|
||||
|
||||
Copyright (C) 2002, 2005, 2009-2012 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 <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
/* Don't override system declarations of SIG2STR_MAX, sig2str, str2sig. */
|
||||
#ifndef SIG2STR_MAX
|
||||
|
||||
# include "intprops.h"
|
||||
|
||||
/* Size of a buffer needed to hold a signal name like "HUP". */
|
||||
# define SIG2STR_MAX (sizeof "SIGRTMAX" + INT_STRLEN_BOUND (int) - 1)
|
||||
|
||||
int sig2str (int, char *);
|
||||
int str2sig (char const *, int *);
|
||||
|
||||
#endif
|
||||
|
||||
/* An upper bound on signal numbers allowed by the system. */
|
||||
|
||||
#if defined _sys_nsig
|
||||
# define SIGNUM_BOUND (_sys_nsig - 1)
|
||||
#elif defined NSIG
|
||||
# define SIGNUM_BOUND (NSIG - 1)
|
||||
#else
|
||||
# define SIGNUM_BOUND 64
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue