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 116182 2003-06-11 00:56:59Z obrien $");
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 (seltrue(dev, events, td) | POLLHUP);
495
496 /*
497 * Need to block timeouts (ttrstart).
498 */
499 s = spltty();
500
501 if (events & (POLLIN | POLLRDNORM))
502 if ((tp->t_state & TS_ISOPEN) &&
--- 366 unchanged lines hidden ---
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 116182 2003-06-11 00:56:59Z obrien $");
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 (seltrue(dev, events, td) | POLLHUP);
495
496 /*
497 * Need to block timeouts (ttrstart).
498 */
499 s = spltty();
500
501 if (events & (POLLIN | POLLRDNORM))
502 if ((tp->t_state & TS_ISOPEN) &&
--- 366 unchanged lines hidden ---