Deleted Added
full compact
pty.c (77360) pty.c (78405)
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 77360 2001-05-28 20:22:12Z phk $
34 * $FreeBSD: head/sys/kern/tty_pty.c 78405 2001-06-18 09:22:30Z brian $
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "opt_compat.h"
42#include <sys/param.h>

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

138 */
139static dev_t
140ptyinit(dev_t devc)
141{
142 dev_t devs;
143 struct pt_ioctl *pt;
144 int n;
145
35 */
36
37/*
38 * Pseudo-teletype Driver
39 * (Actually two drivers, requiring two entries in 'cdevsw')
40 */
41#include "opt_compat.h"
42#include <sys/param.h>

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

138 */
139static dev_t
140ptyinit(dev_t devc)
141{
142 dev_t devs;
143 struct pt_ioctl *pt;
144 int n;
145
146 devc->si_flags &= ~SI_CHEAPCLONE;
147 n = minor(devc);
148 /* For now we only map the lower 8 bits of the minor */
149 if (n & ~0xff)
150 return (NODEV);
151
146 n = minor(devc);
147 /* For now we only map the lower 8 bits of the minor */
148 if (n & ~0xff)
149 return (NODEV);
150
151 devc->si_flags &= ~SI_CHEAPCLONE;
152
152 pt = malloc(sizeof(*pt), M_PTY, M_WAITOK | M_ZERO);
153 pt->devs = devs = make_dev(&pts_cdevsw, n,
154 UID_ROOT, GID_WHEEL, 0666, "tty%c%r", names[n / 32], n % 32);
155 pt->devc = devc;
156
157 devs->si_drv1 = devc->si_drv1 = pt;
158 devs->si_tty = devc->si_tty = &pt->pt_tty;
159 pt->pt_tty.t_dev = devs;

--- 695 unchanged lines hidden ---
153 pt = malloc(sizeof(*pt), M_PTY, M_WAITOK | M_ZERO);
154 pt->devs = devs = make_dev(&pts_cdevsw, n,
155 UID_ROOT, GID_WHEEL, 0666, "tty%c%r", names[n / 32], n % 32);
156 pt->devc = devc;
157
158 devs->si_drv1 = devc->si_drv1 = pt;
159 devs->si_tty = devc->si_tty = &pt->pt_tty;
160 pt->pt_tty.t_dev = devs;

--- 695 unchanged lines hidden ---