85 lines
2.1 KiB
Text
85 lines
2.1 KiB
Text
$NetBSD: patch-ai,v 1.2 2012/05/04 16:38:44 joerg Exp $
|
|
|
|
--- 9term/pty.c.orig 1994-07-22 15:47:29.000000000 +0000
|
|
+++ 9term/pty.c
|
|
@@ -11,8 +11,21 @@
|
|
#include <text.h>
|
|
|
|
#include <utmp.h>
|
|
+#include <ctype.h>
|
|
#include <errno.h>
|
|
-#ifdef SUNOS
|
|
+#include <sys/ioctl.h>
|
|
+
|
|
+#include <sys/param.h>
|
|
+
|
|
+#if (defined(BSD) && BSD >= 199306)
|
|
+# include <termios.h>
|
|
+
|
|
+/* # include <stropts.h> */
|
|
+ /* Isn't POSIX and portability so much fun? */
|
|
+# define VRPRNT VREPRINT
|
|
+#endif
|
|
+
|
|
+#if defined(SUNOS) && !(defined(BSD) && BSD >= 199306)
|
|
# undef _POSIX_SOURCE
|
|
# include <sys/termio.h>
|
|
# include <stropts.h>
|
|
@@ -41,7 +54,7 @@
|
|
# define VEOL2 _VEOL2
|
|
#endif
|
|
|
|
-#ifdef RISCOS
|
|
+#ifdef RISCOS
|
|
# include <sys/stat.h>
|
|
# include </usr/include/ctype.h> /* to defeat posix version */
|
|
# define VLNEXT V_LNEXT
|
|
@@ -49,10 +62,12 @@
|
|
# define VRPRNT V_RPRNT
|
|
# define VWERASE V_WERAS
|
|
#else
|
|
+#if !(defined(BSD) && BSD >= 199306)
|
|
# include <ctype.h>
|
|
#endif
|
|
+#endif
|
|
|
|
-#ifdef OSF1
|
|
+#if defined(OSF1)
|
|
# define V_START VSTART
|
|
# define V_STOP VSTOP
|
|
# define V_SUSP VSUSP
|
|
@@ -115,7 +130,7 @@ struct modenames {
|
|
char udef, p9def;
|
|
};
|
|
|
|
-#if defined(SUNOS) || defined(IRIX) || defined(SOLARIS)
|
|
+#if defined(SUNOS) || defined(IRIX) || defined(SOLARIS) || (defined(BSD) && BSD >= 199306)
|
|
# define V_START VSTART
|
|
# define V_STOP VSTOP
|
|
# define V_SUSP VSUSP
|
|
@@ -139,7 +154,7 @@ modenames ttymodelist[] = {
|
|
#ifndef _POSIX_SOURCE
|
|
{ "eol2", 4, VEOL2, 0, 0 },
|
|
#endif
|
|
-#if !defined(_OSF_SOURCE) && !defined(_POSIX_SOURCE)
|
|
+#if !defined(_OSF_SOURCE) && !defined(_POSIX_SOURCE) && !(defined(BSD) && BSD >= 199306)
|
|
{ "swtch", 5, VSWTCH, 0, 0 },
|
|
#endif
|
|
{ "start", 5, V_START, ctrl('q'), ctrl('q') },
|
|
@@ -292,10 +307,16 @@ gttymodes(int fd)
|
|
/* Insure some sanity. */
|
|
ttmode.c_lflag |= ECHO;
|
|
ttmode.c_oflag &= ~(ONLCR);
|
|
+#if !(defined(BSD) && BSD >= 199306)
|
|
ttmode.c_oflag |= ONLRET;
|
|
+#endif
|
|
} else {
|
|
ttmode.c_iflag = BRKINT | IGNPAR | ICRNL | IXON;
|
|
+#if (defined(BSD) && BSD >= 199306)
|
|
+ ttmode.c_oflag = OPOST;
|
|
+#else
|
|
ttmode.c_oflag = OPOST | ONLRET;
|
|
+#endif
|
|
ttmode.c_cflag = B9600 | PARENB | CS8 | CREAD;
|
|
ttmode.c_lflag = ISIG | ICANON | ECHO | ECHOK;
|
|
#ifdef __ultrix
|