summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_tty.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-09-23 16:51:11 +0000
committermillert <millert@openbsd.org>2003-09-23 16:51:11 +0000
commit154dfaaa7e8e47825c6990a73b3eba25e82ebbb9 (patch)
treebae4f380ce55fc233a68444dffc895a9dabf0b91 /sys/kern/tty_tty.c
parentregen (Prepare for conversion of select backend -> poll) (diff)
downloadwireguard-openbsd-154dfaaa7e8e47825c6990a73b3eba25e82ebbb9.tar.xz
wireguard-openbsd-154dfaaa7e8e47825c6990a73b3eba25e82ebbb9.zip
Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater poll(2) functionality instead of emulating it via the select backend. Adapted from NetBSD and including some changes from FreeBSD. Tested by many, deraadt@ OK
Diffstat (limited to 'sys/kern/tty_tty.c')
-rw-r--r--sys/kern/tty_tty.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 6c09bf4dbad..2c6ea90231b 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_tty.c,v 1.7 2003/06/02 23:28:06 millert Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.8 2003/09/23 16:51:12 millert Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
@@ -143,14 +143,14 @@ cttyioctl(dev, cmd, addr, flag, p)
/*ARGSUSED*/
int
-cttyselect(dev, flag, p)
+cttypoll(dev, events, p)
dev_t dev;
- int flag;
+ int events;
struct proc *p;
{
struct vnode *ttyvp = cttyvp(p);
- if (ttyvp == NULL)
- return (1); /* try operation to get EOF/failure */
- return (VOP_SELECT(ttyvp, flag, FREAD|FWRITE, NOCRED, p));
+ if (ttyvp == NULL) /* try operation to get EOF/failure */
+ return (seltrue(dev, events, p));
+ return (VOP_POLL(ttyvp, events, p));
}