[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Real TIOCSETP



tty.c, file.h, xbios.c: ++entropy@terminator.rs.itd.umich.edu
	Add a real TIOCSETP (differs from TIOCSETN in that it waits for
	the output buffer to be empty if the device supports TIOCOUTQ.)
	Remove a kludge in rsconf() which is not needed if a real TIOCSETP
	exists.

--- 1.10.1.2	1994/02/27 04:02:16
+++ tty.c	1994/02/27 04:10:14
@@ -454,6 +454,7 @@
 	int i;
 	long baud;
 	short flags;
+	long outq;
 
 	if (!is_terminal(f)) {
 		DEBUG(("tty_ioctl(mode %x): file is not a tty", mode));
@@ -481,6 +482,10 @@
 		*sg = tty->sg;
 		return 0;
 	case TIOCSETP:
+		while (((*f->dev->ioctl)(f, TIOCOUTQ, &outq) == 0) && outq)
+			nap(200);
+		/* FALL THROUGH */
+	case TIOCSETN:
 		sg = (struct sgttyb *)arg;
 		tty->sg = *sg;
 		/* set the tty state for checking control characters */
--- 1.10	1994/02/17 08:01:22
+++ xbios.c	1994/02/26 13:54:26
@@ -187,6 +187,7 @@
 		else if (baud > -1)
 			oldbaud = baud;
 	}
+#if 0 /* now handled in tty.c (real TIOCSETP) */
 /* This part _is_ necessary on TOS 1.04 */
 	if (tosvers <= 0x0104) {
 		int attempts = 0;
@@ -206,6 +207,7 @@
 			nap(200);
 		}
 	}
+#endif
 #endif /* ONLY030 */
 
 	rsval = Rsconf(baud, flow, uc, rs, ts, sc);
--- 1.10.1.2	1994/02/24 16:15:06
+++ file.h	1994/02/26 13:44:04
@@ -340,7 +340,6 @@
 #define FIONWRITE	(('F'<< 8) | 2)
 #define TIOCGETP	(('T'<< 8) | 0)
 #define TIOCSETP	(('T'<< 8) | 1)
-#define TIOCSETN	TIOCSETP
 #define TIOCGETC	(('T'<< 8) | 2)
 #define TIOCSETC	(('T'<< 8) | 3)
 #define TIOCGLTC	(('T'<< 8) | 4)
@@ -361,6 +360,7 @@
 #define TIOCGFLAGS	(('T'<< 8) | 22)
 #define TIOCSFLAGS	(('T'<< 8) | 23)
 #define TIOCOUTQ	(('T'<< 8) | 24)
+#define TIOCSETN	(('T'<< 8) | 25)
 
 /* cursor control Fcntls:
  * NOTE THAT THESE MUST BE TOGETHER

--
entropy -- it's not just a good idea, it's the second law.
Personal mail:      entropy@gnu.ai.mit.edu
MiNT library mail:  entropy@terminator.rs.itd.umich.edu
"what do you have against octal?" -jrb