1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/kern/tty_pty.c 120513 2003-09-27 12:44:06Z phk $"); |
38 39/* 40 * Pseudo-teletype Driver 41 * (Actually two drivers, requiring two entries in 'cdevsw') 42 */ 43#include "opt_compat.h" 44#include "opt_tty.h" 45#include <sys/param.h> --- 440 unchanged lines hidden (view full) --- 486 struct thread *td; 487{ 488 struct tty *tp = dev->si_tty; 489 struct pt_ioctl *pti = dev->si_drv1; 490 int revents = 0; 491 int s; 492 493 if ((tp->t_state & TS_CONNECTED) == 0) |
494 return (events & 495 (POLLHUP | POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM)); |
496 497 /* 498 * Need to block timeouts (ttrstart). 499 */ 500 s = spltty(); 501 502 if (events & (POLLIN | POLLRDNORM)) 503 if ((tp->t_state & TS_ISOPEN) && --- 366 unchanged lines hidden --- |