#if defined(BSD) || defined(STRIDE)
#include <sys/ioctl.h>
-#if !defined (O_NDELAY) && defined (HAVE_PTYS)
+#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
#include <fcntl.h>
#endif /* HAVE_PTYS and no O_NDELAY */
#endif /* BSD or STRIDE */
-#ifdef USG
-#ifdef HAVE_TERMIOS
-#include <termios.h>
-#else
-#include <termio.h>
-#endif
-#include <fcntl.h>
-#endif /* USG */
#ifdef NEED_BSDTTY
#include <bsdtty.h>
#endif /* not IRIS */
#include "systime.h"
-#include "systerm.h"
+#include "systty.h"
#include "lisp.h"
#include "window.h"
#ifndef VMS
#ifndef WAITTYPE
#if !defined (BSD) && !defined (UNIPLUS) && !defined (STRIDE) && !(defined (HPUX) && !defined (NOMULTIPLEJOBS)) && !defined (HAVE_WAIT_HEADER)
-mis;tak-+;;:
#define WAITTYPE int
#define WIFSTOPPED(w) ((w&0377) == 0177)
#define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0)
#define WIFEXITED(w) ((w&0377) == 0)
#define WRETCODE(w) (w >> 8)
#define WSTOPSIG(w) (w >> 8)
-#define WCOREDUMP(w) ((w&0200) != 0)
#define WTERMSIG(w) (w & 0377)
+#ifndef WCOREDUMP
+#define WCOREDUMP(w) ((w&0200) != 0)
+#endif
#else
#ifdef BSD4_1
#include <wait.h>
/* Compute the Lisp form of the process status, p->status, from
the numeric status that was returned by `wait'. */
+Lisp_Object status_convert ();
+
update_status (p)
struct Lisp_Process *p;
{
*symbol = XCONS (l)->car;
tem = XCONS (l)->cdr;
*code = XFASTINT (XCONS (tem)->car);
- tem = XFASTINT (XCONS (tem)->cdr);
+ tem = XCONS (tem)->cdr;
*coredump = !NILP (tem);
}
}
}
\f
#ifdef HAVE_PTYS
-static int pty_process;
/* Open an available pty, returning a file descriptor.
Return -1 on failure.
/* First, disconnect its current controlling terminal. */
#ifdef HAVE_SETSID
setsid ();
+#ifdef TIOCSCTTY
+ /* Make the pty's terminal the controlling terminal. */
+ if (pty_flag && (ioctl (xforkin, TIOCSCTTY, 0) < 0))
+ abort ();
+#endif
#else /* not HAVE_SETSID */
#ifdef USG
/* It's very important to call setpgrp() here and no time
#if defined (BSD) || defined (UNIPLUS) || defined (HPUX)
sigsetmask (SIGEMPTYMASK);
#else /* ordinary USG */
+#if 0
signal (SIGCHLD, sigchld);
+#endif
#endif /* ordinary USG */
#endif /* not BSD4_1 */
#endif /* SIGCHLD */
}
}
}
+ else
+ useconds = 0;
if (! NILP (timeout))
{
{
if (xerrno == EINTR)
FD_ZERO (&Available);
+#ifdef __ultrix__
+ /* Ultrix select seems to return ENOMEM when it is interrupted.
+ Treat it just like EINTR. Bleah. -JimB */
+ else if (xerrno == ENOMEM)
+ FD_ZERO (&Available);
+#endif
#ifdef ALLIANT
/* This happens for no known reason on ALLIANT.
I am guessing that this is the right response. -- RMS. */
Available &= ~(ChannelMask (comm_server));
create_commchan ();
}
-#endif vipc
+#endif /* vipc */
if (! wait_proc)
got_some_input |= nfds > 0;
If NOMSG is zero, insert signal-announcements into process's buffers
right away. */
+static void
process_send_signal (process, signo, current_group, nomsg)
Lisp_Object process;
int signo;
case SIGINT:
ioctl (XFASTINT (p->infd), TIOCGETC, &c);
send_process (proc, &c.t_intrc, 1);
- return Qnil;
+ return;
case SIGQUIT:
ioctl (XFASTINT (p->infd), TIOCGETC, &c);
send_process (proc, &c.t_quitc, 1);
- return Qnil;
+ return;
+#ifdef SIGTSTP
case SIGTSTP:
ioctl (XFASTINT (p->infd), TIOCGLTC, &lc);
send_process (proc, &lc.t_suspc, 1);
- return Qnil;
+ return;
+#endif /* SIGTSTP */
}
#endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */
/* It is possible that the following code would work
case SIGINT:
ioctl (XFASTINT (p->infd), TCGETA, &t);
send_process (proc, &t.c_cc[VINTR], 1);
- return Qnil;
+ return;
case SIGQUIT:
ioctl (XFASTINT (p->infd), TCGETA, &t);
send_process (proc, &t.c_cc[VQUIT], 1);
- return Qnil;
+ return;
+#ifdef SIGTSTP
case SIGTSTP:
ioctl (XFASTINT (p->infd), TCGETA, &t);
send_process (proc, &t.c_cc[VSWTCH], 1);
- return Qnil;
+ return;
+#endif
}
#endif /* ! defined (USG) */
/* If process has terminated, stop waiting for its output. */
if (WIFSIGNALED (w) || WIFEXITED (w))
- if (p->infd)
- FD_CLR (p->infd, &input_wait_mask);
+ if (XFASTINT (p->infd))
+ FD_CLR (XFASTINT (p->infd), &input_wait_mask);
}
/* There was no asynchronous process found for that id. Check
#endif
syms_of_process ()
{
-#ifdef HAVE_PTYS
- pty_process = intern ("pty");
-#endif
#ifdef HAVE_SOCKETS
stream_process = intern ("stream");
#endif