summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c
diff options
context:
space:
mode:
authorpst <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
committerpst <pst@FreeBSD.org>1995-02-25 20:09:44 +0000
commit1dcb420b646ff6fd0ab578e340fd7f26b32ed79d (patch)
tree1f0482b969de4dd457ac5b450c026dcaab6317e2 /sys/kern/tty_pty.c
parent04958419e842202587df95082c8717fe0b164213 (diff)
downloadFreeBSD-src-1dcb420b646ff6fd0ab578e340fd7f26b32ed79d.zip
FreeBSD-src-1dcb420b646ff6fd0ab578e340fd7f26b32ed79d.tar.gz
(a) remove the pointer to each driver's tty structure array from cdevsw
(b) add a function callback vector to tty drivers that will return a pointer to a valid tty structure based upon a dev_t (c) make syscons structures the same size whether or not APM is enabled so utilities don't crash if NAPM changes (and make the damn kernel compile!) (d) rewrite /dev/snp ioctl interface so that it is device driver and i386 independant
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r--sys/kern/tty_pty.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 31a0673..14ef309 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tty_pty.c 8.2 (Berkeley) 9/23/93
- * $Id: tty_pty.c,v 1.5 1994/10/02 17:35:30 phk Exp $
+ * $Id: tty_pty.c,v 1.6 1994/10/29 23:59:48 ache Exp $
*/
/*
@@ -552,6 +552,26 @@ block:
goto again;
}
+struct tty *
+ptydevtotty(dev)
+ dev_t dev;
+{
+ if (minor(dev) >= npty)
+ return (NULL);
+
+ return &pt_tty[minor(dev)];
+}
+
+int
+ptsselect(dev, rw, p)
+ dev_t dev;
+ int rw;
+ struct proc * p;
+{
+ return ttyselect(ptydevtotty(dev), rw, p);
+}
+
+
/*ARGSUSED*/
int
ptyioctl(dev, cmd, data, flag, p)
OpenPOWER on IntegriCloud