* Copyright (c) 1991 The Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
"@(#) Copyright (c) 1991 The Regents of the University of California.\n\
/*static char sccsid[] = "from: @(#)mksignames.c 5.1 (Berkeley) 3/7/91";*/
static char rcsid
[] = "mksignames.c,v 1.4 1993/08/01 18:58:07 mycroft Exp";
* This program generates the signames.h and signames.c files.
int signo
; /* signal number */
char *name
; /* signal name (without leading "SIG") */
char *mesg
; /* description */
SIGINT
, "INT", "Interrupt", /* normally don't print message */
SIGILL
, "ILL", "Illegal instruction",
SIGTRAP
, "TRAP", "Trace/BPT trap",
SIGABRT
, "ABRT", "abort",
#if defined(SIGIOT) && (! defined(SIGABRT) || SIGABRT != SIGIOT)
SIGEMT
, "EMT", "EMT trap",
SIGFPE
, "FPE", "Floating exception",
SIGKILL
, "KILL", "Killed",
SIGBUS
, "BUS", "Bus error",
SIGSEGV
, "SEGV", "Memory fault",
SIGSYS
, "SYS", "Bad system call",
SIGPIPE
, "PIPE", "Broken pipe", /* normally don't print message */
SIGALRM
, "ALRM", "Alarm call",
SIGTERM
, "TERM", "Terminated",
SIGUSR1
, "USR1", "User signal 1",
SIGUSR2
, "USR2", "User signal 2",
#if defined(SIGCHLD) && ! defined(SIGCLD)
SIGPWR
, "PWR", "Power fail",
/* Now for the BSD signals */
SIGSTOP
, "STOP", "Stopped",
SIGTSTP
, "TSTP", "Stopped",
SIGTTIN
, "TTIN", "Stopped (input)",
SIGTTOU
, "TTOU", "Stopped (output)",
SIGXCPU
, "XCPU", "Time limit exceeded",
SIGVTALARM
, "VTALARM", "Virtual alarm",
SIGPROF
, "PROF", "Profiling alarm",
char *sigmesg
[MAXSIG
+ 1];
* This file was generated by the mksignames program.\n\
main(argc
, argv
) char **argv
; {
if ((cfile
= fopen("signames.c", "w")) == NULL
) {
fputs("Can't create signames.c\n", stderr
);
if ((hfile
= fopen("signames.h", "w")) == NULL
) {
fputs("Can't create signames.h\n", stderr
);
for (sigp
= sigtab
; sigp
->signo
!= 0 ; sigp
++) {
if (sigp
->signo
< 0 || sigp
->signo
> MAXSIG
)
sigmesg
[sigp
->signo
] = sigp
->mesg
;
if (maxsig
< sigp
->signo
)
fprintf(hfile
, "#define MAXSIG %d\n\n", maxsig
);
fprintf(hfile
, "extern char *const sigmesg[MAXSIG+1];\n");
fprintf(cfile
, "#include \"shell.h\"\n\n");
fprintf(cfile
, "char *const sigmesg[%d] = {\n", maxsig
+ 1);
for (i
= 0 ; i
<= maxsig
; i
++) {
if (sigmesg
[i
] == NULL
) {
fprintf(cfile
, " \"%s\",\n", sigmesg
[i
]);