From f49ed664b22540deee800640ca1ffe1e9cd57361 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 8 Nov 1990 11:12:58 +0000 Subject: [PATCH] * (OS_job_control_p): New procedure. * (OS_open_pty_master): Signal error if none available. * (OS_pty_master_send_signal): Conditionalize use of TIOCSIGSEND on that symbol, not on _HPUX. * (OS_pty_master_kill, OS_pty_master_stop, OS_pty_master_continue, OS_pty_master_interrupt, OS_pty_master_quit): New procedures. --- v7/src/microcode/osterm.h | 8 +++++- v7/src/microcode/uxterm.c | 55 +++++++++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/v7/src/microcode/osterm.h b/v7/src/microcode/osterm.h index a9bb60daf..9ffbeb358 100644 --- a/v7/src/microcode/osterm.h +++ b/v7/src/microcode/osterm.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osterm.h,v 1.4 1990/11/05 11:55:01 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osterm.h,v 1.5 1990/11/08 11:12:58 cph Rel $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -54,8 +54,14 @@ extern void EXFUN (OS_terminal_nonbuffered, (Tchannel channel)); extern void EXFUN (OS_terminal_flush_input, (Tchannel channel)); extern void EXFUN (OS_terminal_flush_output, (Tchannel channel)); extern void EXFUN (OS_terminal_drain_output, (Tchannel channel)); +extern int EXFUN (OS_job_control_p, (void)); extern CONST char * EXFUN (OS_open_pty_master, (Tchannel * master_fd, CONST char ** master_fname)); extern void EXFUN (OS_pty_master_send_signal, (Tchannel channel, int sig)); +extern void EXFUN (OS_pty_master_kill, (Tchannel channel)); +extern void EXFUN (OS_pty_master_stop, (Tchannel channel)); +extern void EXFUN (OS_pty_master_continue, (Tchannel channel)); +extern void EXFUN (OS_pty_master_interrupt, (Tchannel channel)); +extern void EXFUN (OS_pty_master_quit, (Tchannel channel)); #endif /* SCM_OSTERM_H */ diff --git a/v7/src/microcode/uxterm.c b/v7/src/microcode/uxterm.c index 6462dc8c0..6feac4be7 100644 --- a/v7/src/microcode/uxterm.c +++ b/v7/src/microcode/uxterm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxterm.c,v 1.6 1990/11/05 11:55:29 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxterm.c,v 1.7 1990/11/08 11:12:40 cph Exp $ Copyright (c) 1990 Massachusetts Institute of Technology @@ -418,11 +418,18 @@ DEFUN (OS_terminal_drain_output, (channel), Tchannel channel) STD_VOID_SYSTEM_CALL ("tcdrain", (UX_tcdrain (CHANNEL_DESCRIPTOR (channel)))); } + +int +DEFUN_VOID (OS_job_control_p) +{ + return (UX_SC_JOB_CONTROL ()); +} #ifdef HAVE_PTYS /* Open an available pty, putting channel in (*ptyv), - and return the file name of the pty. Return 0 if none available. */ + and return the file name of the pty. + Signal error if none available. */ CONST char * DEFUN (OS_open_pty_master, (master_fd, master_fname), @@ -452,7 +459,7 @@ DEFUN (OS_open_pty_master, (master_fd, master_fname), if (fd < 0) { if (errno == EACCES) - return (0); + goto loser; if (errno != EINTR) continue; deliver_pending_interrupts (); @@ -474,17 +481,19 @@ DEFUN (OS_open_pty_master, (master_fd, master_fname), (*master_fname) = master_name; return (slave_name); } + loser: + error_external_return (); return (0); } void DEFUN (OS_pty_master_send_signal, (channel, sig), Tchannel channel AND int sig) { -#ifdef _HPUX +#ifdef TIOCSIGSEND STD_VOID_SYSTEM_CALL ("ioctl_TIOCSIGSEND", (UX_ioctl ((CHANNEL_DESCRIPTOR (channel)), TIOCSIGSEND, sig))); -#else /* not _HPUX */ +#else /* not TIOCSIGSEND */ #ifdef HAVE_BSD_JOB_CONTROL int fd = (CHANNEL_DESCRIPTOR (channel)); int gid; @@ -493,9 +502,9 @@ DEFUN (OS_pty_master_send_signal, (channel, sig), Tchannel channel AND int sig) #else /* not HAVE_BSD_JOB_CONTROL */ error_unimplemented_primitive (); #endif /* HAVE_BSD_JOB_CONTROL */ -#endif /* _HPUX */ +#endif /* TIOCSIGSEND */ } - + #else /* not HAVE_PTYS */ CONST char * @@ -503,7 +512,7 @@ DEFUN (OS_open_pty_master, (master_fd, master_fname), Tchannel * master_fd AND CONST char ** master_fname) { - return (0); + error_unimplemented_primitive (); } void @@ -513,3 +522,33 @@ DEFUN (OS_pty_master_send_signal, (channel, sig), Tchannel channel AND int sig) } #endif /* HAVE_PTYS */ + +void +DEFUN (OS_pty_master_kill, (channel), Tchannel channel) +{ + OS_pty_master_send_signal (channel, SIGKILL); +} + +void +DEFUN (OS_pty_master_stop, (channel), Tchannel channel) +{ + OS_pty_master_send_signal (channel, SIGTSTP); +} + +void +DEFUN (OS_pty_master_continue, (channel), Tchannel channel) +{ + OS_pty_master_send_signal (channel, SIGCONT); +} + +void +DEFUN (OS_pty_master_interrupt, (channel), Tchannel channel) +{ + OS_pty_master_send_signal (channel, SIGINT); +} + +void +DEFUN (OS_pty_master_quit, (channel), Tchannel channel) +{ + OS_pty_master_send_signal (channel, SIGQUIT); +} -- 2.25.1