changeset 3826:647bef18618f

Changes for Irix 4.0, tested this time: * s/irix4-0.h: Get rid of our fake definitions for setpgrp and getpgrp. * callproc.c (Fcall_process): Go ahead and use the USG calling convention for setpgrp. * ymakefile (pre-crt0.o): Add rule for this. Perhaps it will help separate-source-directory compilation. * emacs.c (shut_down_emacs): Some USG systems #define EMACS_HAVE_TTY_PGRP; call getpgrp as appropriate for such systems. * sysdep.c (sys_suspend): Call getpgrp as appropriate for USG and non-USG. * process.c [IRIX] (create_process): Don't put child in process group zero before opening the tty; Irix is like USG in this regard.
author Jim Blandy <jimb@redhat.com>
date Fri, 18 Jun 1993 23:33:20 +0000
parents ae1462a1a8d4
children 4089cf0e3f06
files src/callproc.c src/emacs.c src/process.c src/s/irix4-0.h src/sysdep.c
diffstat 5 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/callproc.c	Fri Jun 18 21:40:46 1993 +0000
+++ b/src/callproc.c	Fri Jun 18 23:33:20 1993 +0000
@@ -255,7 +255,7 @@
       {
 	if (fd[0] >= 0)
 	  close (fd[0]);
-#if defined (USG) && !defined (IRIX)
+#ifdef USG
         setpgrp ();
 #else
         setpgrp (pid, pid);
--- a/src/emacs.c	Fri Jun 18 21:40:46 1993 +0000
+++ b/src/emacs.c	Fri Jun 18 23:33:20 1993 +0000
@@ -681,9 +681,14 @@
   /* If we are controlling the terminal, reset terminal modes */
 #ifdef EMACS_HAVE_TTY_PGRP
   {
+#ifdef USG
+    int pgrp = getpgrp ();
+#else
+    int pgrp = getpgrp (0);
+#endif
     int tpgrp;
     if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1
-	&& tpgrp == getpgrp (0))
+	&& tpgrp == pgrp)
       {
 	fflush (stdout);
 	reset_sys_modes ();
--- a/src/process.c	Fri Jun 18 21:40:46 1993 +0000
+++ b/src/process.c	Fri Jun 18 23:33:20 1993 +0000
@@ -1282,7 +1282,7 @@
 	    int j = open ("/dev/tty", O_RDWR, 0);
 	    ioctl (j, TIOCNOTTY, 0);
 	    close (j);
-#if !defined (USG) || defined (IRIX)
+#ifndef USG
 	    /* In order to get a controlling terminal on some versions
 	       of BSD, it is necessary to put the process in pgrp 0
 	       before it opens the terminal.  */
--- a/src/s/irix4-0.h	Fri Jun 18 21:40:46 1993 +0000
+++ b/src/s/irix4-0.h	Fri Jun 18 23:33:20 1993 +0000
@@ -50,10 +50,6 @@
   strcpy (pty_name, name);					\
 }
 
-/* Use the BSD versions of the getpgrp and setpgrp functions.  */
-#define setpgrp(pid, pgrp) BSDsetpgrp((pid), (pgrp))
-#define getpgrp(pid)       BSDgetpgrp(pid)
-
 /* jpff@maths.bath.ac.uk reports `struct exception' is not defined
    on this system, so inhibit use of matherr.  */
 #define NO_MATHERR
--- a/src/sysdep.c	Fri Jun 18 21:40:46 1993 +0000
+++ b/src/sysdep.c	Fri Jun 18 23:33:20 1993 +0000
@@ -571,7 +571,14 @@
 #else
 #ifdef SIGTSTP
 
-  EMACS_KILLPG (getpgrp (0), SIGTSTP);
+  {
+#ifdef USG
+    int pgrp = getpgrp ();
+#else
+    int pgrp = getpgrp (0);
+#endif
+    EMACS_KILLPG (pgrp, SIGTSTP);
+  }
 
 #else /* No SIGTSTP */
 #ifdef USG_JOBCTRL /* If you don't know what this is don't mess with it */