requires COMPAT_43 to build
[unix-history] / usr / src / sys / hp / hpux / hpux_tty.c
index eb8c2b1..e4e2458 100644 (file)
@@ -9,29 +9,32 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- * from: Utah $Hdr: hpux_tty.c 1.1 90/07/09$
+ * from: Utah $Hdr: hpux_tty.c 1.12 92/04/15$
  *
  *
- *     @(#)hpux_tty.c  7.11 (Berkeley) %G%
+ *     @(#)hpux_tty.c  7.15 (Berkeley) %G%
  */
 
 /*
  * stty/gtty/termio emulation stuff
  */
 #ifdef HPUXCOMPAT
  */
 
 /*
  * stty/gtty/termio emulation stuff
  */
 #ifdef HPUXCOMPAT
+#ifndef COMPAT_43
+#define COMPAT_43
+#endif
 
 
-#include "param.h"
-#include "systm.h"
-#include "filedesc.h"
-#include "ioctl.h"
-#include "proc.h"
-#include "tty.h"
-#include "file.h"
-#include "conf.h"
-#include "buf.h"
-#include "kernel.h"
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/filedesc.h>
+#include <sys/ioctl.h>
+#include <sys/proc.h>
+#include <sys/tty.h>
+#include <sys/file.h>
+#include <sys/conf.h>
+#include <sys/buf.h>
+#include <sys/kernel.h>
 
 
-#include "hpux.h"
-#include "hpux_termio.h"
+#include <hp/hpux/hpux.h>
+#include <hp/hpux/hpux_termio.h>
 
 /*
  * Map BSD/POSIX style termios info to and from SYS5 style termio stuff.
 
 /*
  * Map BSD/POSIX style termios info to and from SYS5 style termio stuff.
@@ -164,15 +167,15 @@ hpuxtermio(fp, com, data, p)
        case HPUXTCSETA:
        case HPUXTCSETAW:
        case HPUXTCSETAF:
        case HPUXTCSETA:
        case HPUXTCSETAW:
        case HPUXTCSETAF:
-               if (newi)
-                       bcopy(data, (char *)&htios, sizeof htios);
-               else
-                       termiototermios((struct termio *)data, &htios);
                /*
                 * Get old characteristics and determine if we are a tty.
                 */
                if (error = (*ioctlrout)(fp, TIOCGETA, (caddr_t)&tios, p))
                        break;
                /*
                 * Get old characteristics and determine if we are a tty.
                 */
                if (error = (*ioctlrout)(fp, TIOCGETA, (caddr_t)&tios, p))
                        break;
+               if (newi)
+                       bcopy(data, (char *)&htios, sizeof htios);
+               else
+                       termiototermios((struct termio *)data, &htios, &tios);
                /*
                 * Set iflag.
                 * Same through ICRNL, no HP-UX equiv for IMAXBEL
                /*
                 * Set iflag.
                 * Same through ICRNL, no HP-UX equiv for IMAXBEL
@@ -306,9 +309,10 @@ hpuxtermio(fp, com, data, p)
        return(error);
 }
 
        return(error);
 }
 
-termiototermios(tio, tios)
+termiototermios(tio, tios, bsdtios)
        struct hpuxtermio *tio;
        struct hpuxtermios *tios;
        struct hpuxtermio *tio;
        struct hpuxtermios *tios;
+       struct termios *bsdtios;
 {
        int i;
 
 {
        int i;
 
@@ -329,6 +333,11 @@ termiototermios(tio, tios)
                tios->c_cc[HPUXVMINS] = tio->c_cc[HPUXVMIN];
                tios->c_cc[HPUXVTIMES] = tio->c_cc[HPUXVTIME];
        }
                tios->c_cc[HPUXVMINS] = tio->c_cc[HPUXVMIN];
                tios->c_cc[HPUXVTIMES] = tio->c_cc[HPUXVTIME];
        }
+       tios->c_cc[HPUXVMINS] = bsdtios->c_cc[VMIN];
+       tios->c_cc[HPUXVTIMES] = bsdtios->c_cc[VTIME];
+       tios->c_cc[HPUXVSUSP] = bsdtios->c_cc[VSUSP];
+       tios->c_cc[HPUXVSTART] = bsdtios->c_cc[VSTART];
+       tios->c_cc[HPUXVSTOP] = bsdtios->c_cc[VSTOP];
 }
 
 termiostotermio(tios, tio)
 }
 
 termiostotermio(tios, tio)
@@ -344,7 +353,7 @@ termiostotermio(tios, tio)
        tio->c_line = tios->c_reserved;
        for (i = 0; i <= HPUXVSWTCH; i++)
                tio->c_cc[i] = tios->c_cc[i];
        tio->c_line = tios->c_reserved;
        for (i = 0; i <= HPUXVSWTCH; i++)
                tio->c_cc[i] = tios->c_cc[i];
-       if (tios->c_lflag & ICANON) {
+       if (tios->c_lflag & TIO_ICANON) {
                tio->c_cc[HPUXVEOF] = tios->c_cc[HPUXVEOF];
                tio->c_cc[HPUXVEOL] = tios->c_cc[HPUXVEOL];
        } else {
                tio->c_cc[HPUXVEOF] = tios->c_cc[HPUXVEOF];
                tio->c_cc[HPUXVEOL] = tios->c_cc[HPUXVEOL];
        } else {
@@ -391,12 +400,13 @@ hpuxtobsdbaud(hpuxspeed)
 }
 
 #ifdef COMPAT_OHPUX
 }
 
 #ifdef COMPAT_OHPUX
+struct ohpuxsgtty_args {
+       int     fdes;
+       caddr_t cmarg;
+};
 ohpuxgtty(p, uap, retval)
        struct proc *p;
 ohpuxgtty(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     fdes;
-               caddr_t cmarg;
-       } *uap;
+       struct ohpuxsgtty_args *uap;
        int *retval;
 {
 
        int *retval;
 {
 
@@ -405,10 +415,7 @@ ohpuxgtty(p, uap, retval)
 
 ohpuxstty(p, uap, retval)
        struct proc *p;
 
 ohpuxstty(p, uap, retval)
        struct proc *p;
-       struct args {
-               int     fdes;
-               caddr_t cmarg;
-       } *uap;
+       struct ohpuxsgtty_args *uap;
        int *retval;
 {
 
        int *retval;
 {