* (OS_job_control_p): New procedure.
authorChris Hanson <org/chris-hanson/cph>
Thu, 8 Nov 1990 11:12:58 +0000 (11:12 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 8 Nov 1990 11:12:58 +0000 (11:12 +0000)
* (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
v7/src/microcode/uxterm.c

index a9bb60dafc2befe5a7f36f2789a26476937dd1db..9ffbeb358c6731ba9d9f5edbbf8919562b5cf5ba 100644 (file)
@@ -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 */
index 6462dc8c0e1c932b6166ee71e18044a3ed0ecd74..6feac4be7abaf132c81623f8f445daf50196b20a 100644 (file)
@@ -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 ());
+}
 \f
 #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 */
 }
-
+\f
 #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);
+}