Deleted Added
full compact
pty.c (3308) pty.c (3998)
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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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.2 (Berkeley) 9/23/93
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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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.2 (Berkeley) 9/23/93
34 * $Id: tty_pty.c,v 1.4 1994/09/15 19:47:16 bde Exp $
34 * $Id: tty_pty.c,v 1.5 1994/10/02 17:35:30 phk Exp $
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "pty.h" /* XXX */
42

--- 217 unchanged lines hidden (view full) ---

260 struct pt_ioctl *pti = &pt_ioctl[minor(tp->t_dev)];
261
262 if (flag & FREAD) {
263 selwakeup(&pti->pt_selr);
264 wakeup((caddr_t)&tp->t_outq.c_cf);
265 }
266 if (flag & FWRITE) {
267 selwakeup(&pti->pt_selw);
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "pty.h" /* XXX */
42

--- 217 unchanged lines hidden (view full) ---

260 struct pt_ioctl *pti = &pt_ioctl[minor(tp->t_dev)];
261
262 if (flag & FREAD) {
263 selwakeup(&pti->pt_selr);
264 wakeup((caddr_t)&tp->t_outq.c_cf);
265 }
266 if (flag & FWRITE) {
267 selwakeup(&pti->pt_selw);
268 wakeup((caddr_t)&tp->t_rawq.c_cf);
268 wakeup((caddr_t)&tp->t_rawq.c_cl);
269 }
270}
271
272/*ARGSUSED*/
273#ifdef __STDC__
274int
275ptcopen(dev_t dev, int flag, int devtype, struct proc *p)
276#else

--- 261 unchanged lines hidden (view full) ---

538 return (EIO);
539 if (flag & IO_NDELAY) {
540 /* adjust for data copied in but not written */
541 uio->uio_resid += cc;
542 if (cnt == 0)
543 return (EWOULDBLOCK);
544 return (0);
545 }
269 }
270}
271
272/*ARGSUSED*/
273#ifdef __STDC__
274int
275ptcopen(dev_t dev, int flag, int devtype, struct proc *p)
276#else

--- 261 unchanged lines hidden (view full) ---

538 return (EIO);
539 if (flag & IO_NDELAY) {
540 /* adjust for data copied in but not written */
541 uio->uio_resid += cc;
542 if (cnt == 0)
543 return (EWOULDBLOCK);
544 return (0);
545 }
546 error = tsleep((caddr_t)&tp->t_rawq.c_cf, TTOPRI | PCATCH, ttyout, 0);
546 error = tsleep((caddr_t)&tp->t_rawq.c_cl, TTOPRI | PCATCH, ttyout, 0);
547 if (error) {
548 /* adjust for data copied in but not written */
549 uio->uio_resid += cc;
550 return (error);
551 }
552 goto again;
553}
554

--- 157 unchanged lines hidden ---
547 if (error) {
548 /* adjust for data copied in but not written */
549 uio->uio_resid += cc;
550 return (error);
551 }
552 goto again;
553}
554

--- 157 unchanged lines hidden ---