Article View: comp.bugs.4bsd
Article #389Can't change line discipline on pty
From: Jonathan Stone
Date: Fri, 14 Jun 1991 02:31
Date: Fri, 14 Jun 1991 02:31
63 lines
2356 bytes
2356 bytes
Subject: Can't change line discipline on pty
Index: /sys/kern/tty_pty.c
Description:
The pty driver refuses to change the line discipline on
pty terminals to anything other than the standard tty line
discipline. Comments in the code claim that this is because
other line disciplines may over-write the tty queues. The
SLIP line discipline respects the tty queues, and in certain
regrettable circumstances it is useful to run SLIP through a pty.
(Please don't ask what they are.)
Repeat-By:
Run slattach(8) or sliplogin(8) on a pty.
Fix:
Apply the following patch to a kernel with SLIP configured,
and rebuild the kernel. The compile-time test for
configuration of SLIP should not be necessary, but cannot hurt.
Other line disciplines (such as dialup IP) may also be
appropriate for ptys.
*** /sys/kern/tty_pty.c Sun Jul 29 06:48:41 1990
--- /mnt/old.sys/kern/tty_pty.c Sat Jun 8 13:43:26 1991
***************
*** 38,44 ****
--- 38,49 ----
#include "uio.h"
#include "kernel.h"
#include "vnode.h"
+ #include "sl.h"
+ #if NSL > 0
+ extern int slinput();
+ #endif
+
#if NPTY == 1
#undef NPTY
#define NPTY 32 /* crude XXX */
***************
*** 620,626 ****
* the queues. We can't tell anything about the discipline
* from here...
*/
! if (linesw[tp->t_line].l_rint != ttyinput) {
(*linesw[tp->t_line].l_close)(tp);
tp->t_line = 0;
(void)(*linesw[tp->t_line].l_open)(dev, tp, flag);
--- 625,635 ----
* the queues. We can't tell anything about the discipline
* from here...
*/
! if (
! #if NSL > 0
! linesw[tp->t_line].l_rint != slinput &&
! #endif
! linesw[tp->t_line].l_rint != ttyinput) {
(*linesw[tp->t_line].l_close)(tp);
tp->t_line = 0;
(void)(*linesw[tp->t_line].l_open)(dev, tp, flag);
Technical Details
Message-ID:
<1991Jun14.023140.7509@comp.vuw.ac.nz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!beta.isor.vuw.ac.nz!jonathanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!beta.isor.vuw.ac.nz!jonathan From: jonathan@beta.isor.vuw.ac.nz (Jonathan Stone) Newsgroups: comp.bugs.4bsd Subject: Can't change line discipline on pty Message-ID: <1991Jun14.023140.7509@comp.vuw.ac.nz> Date: 14 Jun 91 02:31:40 GMT Sender: news@comp.vuw.ac.nz (News Admin) Organization: Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand. Lines: 63 Nntp-Posting-Host: beta.isor.vuw.ac.nz