merge in vnodes
[unix-history] / usr / src / sys / kern / tty.c
index 0abd03a..56a84b9 100644 (file)
@@ -3,12 +3,11 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)tty.c       7.16 (Berkeley) %G%
+ *     @(#)tty.c       7.17 (Berkeley) %G%
  */
 
 #include "param.h"
 #include "systm.h"
  */
 
 #include "param.h"
 #include "systm.h"
-#include "dir.h"
 #include "user.h"
 #include "ioctl.h"
 #include "tty.h"
 #include "user.h"
 #include "ioctl.h"
 #include "tty.h"
@@ -26,6 +25,7 @@
 #include "dkstat.h"
 #include "uio.h"
 #include "kernel.h"
 #include "dkstat.h"
 #include "uio.h"
 #include "kernel.h"
+#include "vnode.h"
 #include "syslog.h"
 
 #include "machine/reg.h"
 #include "syslog.h"
 
 #include "machine/reg.h"
@@ -604,7 +604,6 @@ ttyopen(dev, tp)
        dev_t dev;
        register struct tty *tp;
 {
        dev_t dev;
        register struct tty *tp;
 {
-       register struct proc *pp;
 
        tp->t_dev = dev;
 
 
        tp->t_dev = dev;
 
@@ -1192,7 +1191,7 @@ loop:
                if (tp->t_state&TS_ISOPEN) {
                        splx(s);
                        return (0);     /* EOF */
                if (tp->t_state&TS_ISOPEN) {
                        splx(s);
                        return (0);     /* EOF */
-               } else if (flag&FNDELAY) {
+               } else if (flag & IO_NDELAY) {
                        splx(s);
                        return (EWOULDBLOCK);
                } else {
                        splx(s);
                        return (EWOULDBLOCK);
                } else {
@@ -1235,7 +1234,7 @@ loop:
                        return (EWOULDBLOCK);
                }
                **/
                        return (EWOULDBLOCK);
                }
                **/
-               if (flag&FNDELAY) {
+               if (flag & IO_NDELAY) {
                        splx(s);
                        return (EWOULDBLOCK);
                }
                        splx(s);
                        return (EWOULDBLOCK);
                }
@@ -1283,7 +1282,6 @@ loop:
                }
                first = 0;
        }
                }
                first = 0;
        }
-checktandem:
        /*
         * Look to unblock output now that (presumably)
         * the input queue has gone down.
        /*
         * Look to unblock output now that (presumably)
         * the input queue has gone down.
@@ -1340,7 +1338,7 @@ ttwrite(tp, uio, flag)
        register struct uio *uio;
 {
        register char *cp;
        register struct uio *uio;
 {
        register char *cp;
-       register int cc, ce, c;
+       register int cc, ce;
        int i, hiwat, cnt, error, s;
        char obuf[OBUFSIZ];
 
        int i, hiwat, cnt, error, s;
        char obuf[OBUFSIZ];
 
@@ -1353,7 +1351,7 @@ loop:
                if (tp->t_state&TS_ISOPEN) {
                        splx(s);
                        return (EIO);
                if (tp->t_state&TS_ISOPEN) {
                        splx(s);
                        return (EIO);
-               } else if (flag&FNDELAY) {
+               } else if (flag & IO_NDELAY) {
                        splx(s);
                        return (EWOULDBLOCK);
                } else {
                        splx(s);
                        return (EWOULDBLOCK);
                } else {
@@ -1403,7 +1401,7 @@ loop:
                if (cc > OBUFSIZ)
                        cc = OBUFSIZ;
                cp = obuf;
                if (cc > OBUFSIZ)
                        cc = OBUFSIZ;
                cp = obuf;
-               error = uiomove(cp, cc, UIO_WRITE, uio);
+               error = uiomove(cp, cc, uio);
                if (error)
                        break;
                if (tp->t_lflag&FLUSHO)
                if (error)
                        break;
                if (tp->t_lflag&FLUSHO)
@@ -1497,7 +1495,7 @@ ovhiwat:
                splx(s);
                goto loop;
        }
                splx(s);
                goto loop;
        }
-       if (flag&FNDELAY) {
+       if (flag & IO_NDELAY) {
                splx(s);
                if (uio->uio_resid == cnt)
                        return (EWOULDBLOCK);
                splx(s);
                if (uio->uio_resid == cnt)
                        return (EWOULDBLOCK);