| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: tty_pty.c,v 1.120 2009/12/20 19:06:44 pooka Exp $ */ | | 1 | /* $NetBSD: tty_pty.c,v 1.121 2010/01/24 19:56:26 dholland Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1982, 1986, 1989, 1993 | | 4 | * Copyright (c) 1982, 1986, 1989, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -27,27 +27,27 @@ | | | @@ -27,27 +27,27 @@ |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | * | | 30 | * |
31 | * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 | | 31 | * @(#)tty_pty.c 8.4 (Berkeley) 2/20/95 |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | /* | | 34 | /* |
35 | * Pseudo-teletype Driver | | 35 | * Pseudo-teletype Driver |
36 | * (Actually two drivers, requiring two entries in 'cdevsw') | | 36 | * (Actually two drivers, requiring two entries in 'cdevsw') |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #include <sys/cdefs.h> | | 39 | #include <sys/cdefs.h> |
40 | __KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.120 2009/12/20 19:06:44 pooka Exp $"); | | 40 | __KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.121 2010/01/24 19:56:26 dholland Exp $"); |
41 | | | 41 | |
42 | #include "opt_ptm.h" | | 42 | #include "opt_ptm.h" |
43 | | | 43 | |
44 | #include <sys/param.h> | | 44 | #include <sys/param.h> |
45 | #include <sys/systm.h> | | 45 | #include <sys/systm.h> |
46 | #include <sys/ioctl.h> | | 46 | #include <sys/ioctl.h> |
47 | #include <sys/ioctl_compat.h> | | 47 | #include <sys/ioctl_compat.h> |
48 | #include <sys/proc.h> | | 48 | #include <sys/proc.h> |
49 | #include <sys/tty.h> | | 49 | #include <sys/tty.h> |
50 | #include <sys/stat.h> | | 50 | #include <sys/stat.h> |
51 | #include <sys/file.h> | | 51 | #include <sys/file.h> |
52 | #include <sys/kernel.h> | | 52 | #include <sys/kernel.h> |
53 | #include <sys/vnode.h> | | 53 | #include <sys/vnode.h> |
| @@ -109,27 +109,31 @@ dev_type_ioctl(ptyioctl); | | | @@ -109,27 +109,31 @@ dev_type_ioctl(ptyioctl); |
109 | dev_type_tty(ptytty); | | 109 | dev_type_tty(ptytty); |
110 | | | 110 | |
111 | const struct cdevsw ptc_cdevsw = { | | 111 | const struct cdevsw ptc_cdevsw = { |
112 | ptcopen, ptcclose, ptcread, ptcwrite, ptyioctl, | | 112 | ptcopen, ptcclose, ptcread, ptcwrite, ptyioctl, |
113 | nullstop, ptytty, ptcpoll, nommap, ptckqfilter, D_TTY | | 113 | nullstop, ptytty, ptcpoll, nommap, ptckqfilter, D_TTY |
114 | }; | | 114 | }; |
115 | | | 115 | |
116 | const struct cdevsw pts_cdevsw = { | | 116 | const struct cdevsw pts_cdevsw = { |
117 | ptsopen, ptsclose, ptsread, ptswrite, ptyioctl, | | 117 | ptsopen, ptsclose, ptsread, ptswrite, ptyioctl, |
118 | ptsstop, ptytty, ptspoll, nommap, ttykqfilter, D_TTY | | 118 | ptsstop, ptytty, ptspoll, nommap, ttykqfilter, D_TTY |
119 | }; | | 119 | }; |
120 | | | 120 | |
121 | #if defined(pmax) | | 121 | #if defined(pmax) |
122 | /* see arch/pmax/conf/majors.pmax */ | | 122 | /* |
| | | 123 | * Used by arch/pmax/conf/majors.pmax, which needs a second copy as it |
| | | 124 | * needs to map this stuff to two pairs of majors. |
| | | 125 | */ |
| | | 126 | |
123 | const struct cdevsw ptc_ultrix_cdevsw = { | | 127 | const struct cdevsw ptc_ultrix_cdevsw = { |
124 | ptcopen, ptcclose, ptcread, ptcwrite, ptyioctl, | | 128 | ptcopen, ptcclose, ptcread, ptcwrite, ptyioctl, |
125 | nullstop, ptytty, ptcpoll, nommap, ptckqfilter, D_TTY | | 129 | nullstop, ptytty, ptcpoll, nommap, ptckqfilter, D_TTY |
126 | }; | | 130 | }; |
127 | | | 131 | |
128 | const struct cdevsw pts_ultrix_cdevsw = { | | 132 | const struct cdevsw pts_ultrix_cdevsw = { |
129 | ptsopen, ptsclose, ptsread, ptswrite, ptyioctl, | | 133 | ptsopen, ptsclose, ptsread, ptswrite, ptyioctl, |
130 | ptsstop, ptytty, ptspoll, nommap, ttykqfilter, D_TTY | | 134 | ptsstop, ptytty, ptspoll, nommap, ttykqfilter, D_TTY |
131 | }; | | 135 | }; |
132 | #endif /* defined(pmax) */ | | 136 | #endif /* defined(pmax) */ |
133 | | | 137 | |
134 | /* | | 138 | /* |
135 | * Check if a pty is free to use. | | 139 | * Check if a pty is free to use. |