version 1.4, 1994/07/08 15:00:45
|
version 1.7, 1995/01/18 18:41:38
|
Line 7
|
Line 7
|
Use -D_POSIX_VERSION for POSIX systems. |
Use -D_POSIX_VERSION for POSIX systems. |
*/ |
*/ |
|
|
|
#include <unistd.h> |
|
|
#ifdef DOMAINOS |
#ifdef DOMAINOS |
#define _POSIX_VERSION |
#define _POSIX_VERSION |
#endif |
#endif |
Line 31
|
Line 33
|
# endif |
# endif |
#endif |
#endif |
|
|
#if defined (HAVE_UNISTD_H) |
|
# include <unistd.h> |
|
#endif |
|
|
|
#define NEW_TTY_DRIVER |
#define NEW_TTY_DRIVER |
#define HAVE_BSD_SIGNALS |
#define HAVE_BSD_SIGNALS |
|
/* |
#ifndef DOMAINOS |
#ifndef DOMAINOS |
#define USE_XON_XOFF |
#define USE_XON_XOFF |
#endif |
#endif |
|
*/ |
|
|
|
#define HANDLE_SIGNALS |
|
|
/* Some USG machines have BSD signal handling (sigblock, sigsetmask, etc.) */ |
/* Some USG machines have BSD signal handling (sigblock, sigsetmask, etc.) */ |
#if defined (USG) && !defined (hpux) |
#if defined (USG) && !defined (hpux) |
Line 48
|
Line 50
|
|
|
/* System V machines use termio. */ |
/* System V machines use termio. */ |
#if !defined (_POSIX_VERSION) |
#if !defined (_POSIX_VERSION) |
# if defined (USG) || defined (hpux) || defined (Xenix) || defined (sgi) || defined (DGUX) || defined (ultrix) |
# if defined (USG) || defined (hpux) || defined (Xenix) || defined (sgi) || defined (DGUX) || defined (ultrix) || defined (Solaris) |
# undef NEW_TTY_DRIVER |
# undef NEW_TTY_DRIVER |
# define TERMIO_TTY_DRIVER |
# define TERMIO_TTY_DRIVER |
# include <termio.h> |
# include <termio.h> |
Line 740 signal_throw(int sig)
|
Line 742 signal_throw(int sig)
|
longjmp(throw_jmp_buf,throw_codes[sig-1]); /* or use siglongjmp ? */ |
longjmp(throw_jmp_buf,throw_codes[sig-1]); /* or use siglongjmp ? */ |
} |
} |
|
|
|
static void |
|
termprep (int sig) |
|
{ |
|
terminal_prepped=0; prep_terminal(); |
|
signal(sig,termprep); |
|
} |
|
|
void |
void |
install_signal_handlers (void) |
install_signal_handlers (void) |
{ |
{ |
Line 751 install_signal_handlers (void)
|
Line 760 install_signal_handlers (void)
|
SIGALRM, SIGBUS |
SIGALRM, SIGBUS |
#define SIGS_TO_QUIT SIGHUP, SIGQUIT, SIGABRT, SIGPIPE, \ |
#define SIGS_TO_QUIT SIGHUP, SIGQUIT, SIGABRT, SIGPIPE, \ |
SIGTERM |
SIGTERM |
|
#define SIGS_TO_TERMPREP SIGCONT |
|
|
static short sigs_to_ignore [] = { SIGS_TO_IGNORE }; |
static short sigs_to_ignore [] = { SIGS_TO_IGNORE }; |
static short sigs_to_abort [] = { SIGS_TO_ABORT }; |
static short sigs_to_abort [] = { SIGS_TO_ABORT }; |
static short sigs_to_quit [] = { SIGS_TO_QUIT }; |
static short sigs_to_quit [] = { SIGS_TO_QUIT }; |
|
static short sigs_to_termprep [] = { SIGS_TO_TERMPREP }; |
int i; |
int i; |
|
|
#define DIM(X) (sizeof (X) / sizeof *(X)) |
#define DIM(X) (sizeof (X) / sizeof *(X)) |
Line 765 install_signal_handlers (void)
|
Line 776 install_signal_handlers (void)
|
signal (sigs_to_abort [i], signal_throw); /* !! change to throw */ |
signal (sigs_to_abort [i], signal_throw); /* !! change to throw */ |
for (i = 0; i < DIM (sigs_to_quit); i++) |
for (i = 0; i < DIM (sigs_to_quit); i++) |
signal (sigs_to_quit [i], graceful_exit); |
signal (sigs_to_quit [i], graceful_exit); |
|
for (i = 0; i < DIM (sigs_to_termprep); i++) |
|
signal (sigs_to_termprep [i], termprep); |
} |
} |
/* end signal handling */ |
/* end signal handling */ |