Deleted Added
full compact
pty.c (59815) pty.c (59818)
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.4 (Berkeley) 2/20/95
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.4 (Berkeley) 2/20/95
34 * $FreeBSD: head/sys/kern/tty_pty.c 59815 2000-05-01 09:05:03Z ache $
34 * $FreeBSD: head/sys/kern/tty_pty.c 59818 2000-05-01 10:24:21Z ache $
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "pty.h" /* XXX */
42#include "opt_compat.h"

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

152 bzero(pt, sizeof(*pt));
153 pt->devs = devs = make_dev(&pts_cdevsw, n,
154 0, 0, 0666, "tty%c%r", names[n / 32], n % 32);
155 pt->devc = devc = make_dev(&ptc_cdevsw, n,
156 0, 0, 0666, "pty%c%r", names[n / 32], n % 32);
157
158 devs->si_drv1 = devc->si_drv1 = pt;
159 devs->si_tty = devc->si_tty = &pt->pt_tty;
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "pty.h" /* XXX */
42#include "opt_compat.h"

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

152 bzero(pt, sizeof(*pt));
153 pt->devs = devs = make_dev(&pts_cdevsw, n,
154 0, 0, 0666, "tty%c%r", names[n / 32], n % 32);
155 pt->devc = devc = make_dev(&ptc_cdevsw, n,
156 0, 0, 0666, "pty%c%r", names[n / 32], n % 32);
157
158 devs->si_drv1 = devc->si_drv1 = pt;
159 devs->si_tty = devc->si_tty = &pt->pt_tty;
160 pt->pt_tty.t_timeout = -1;
161 ttyregister(&pt->pt_tty);
162}
163
164/*ARGSUSED*/
165static int
166ptsopen(dev, flag, devtype, p)
167 dev_t dev;
168 int flag, devtype;

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

351
352 if (!dev->si_drv1)
353 ptyinit(minor(dev));
354 if (!dev->si_drv1)
355 return(ENXIO);
356 tp = dev->si_tty;
357 if (tp->t_oproc)
358 return (EIO);
160 ttyregister(&pt->pt_tty);
161}
162
163/*ARGSUSED*/
164static int
165ptsopen(dev, flag, devtype, p)
166 dev_t dev;
167 int flag, devtype;

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

350
351 if (!dev->si_drv1)
352 ptyinit(minor(dev));
353 if (!dev->si_drv1)
354 return(ENXIO);
355 tp = dev->si_tty;
356 if (tp->t_oproc)
357 return (EIO);
358 tp->t_timeout = -1;
359 tp->t_oproc = ptsstart;
360 tp->t_stop = ptsstop;
361 (void)(*linesw[tp->t_line].l_modem)(tp, 1);
362 tp->t_lflag &= ~EXTPROC;
363 pti = dev->si_drv1;
364 pti->pt_prison = p->p_prison;
365 pti->pt_flags = 0;
366 pti->pt_send = 0;

--- 464 unchanged lines hidden ---
359 tp->t_oproc = ptsstart;
360 tp->t_stop = ptsstop;
361 (void)(*linesw[tp->t_line].l_modem)(tp, 1);
362 tp->t_lflag &= ~EXTPROC;
363 pti = dev->si_drv1;
364 pti->pt_prison = p->p_prison;
365 pti->pt_flags = 0;
366 pti->pt_send = 0;

--- 464 unchanged lines hidden ---