9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  23 /*        All Rights Reserved   */
  24 
  25 
  26 /*
  27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28  * Use is subject to license terms.
  29  */
  30 
  31 /*
  32  * Description:
  33  *
  34  * The PTEM streams module is used as a pseudo driver emulator.  Its purpose
  35  * is to emulate the ioctl() functions of a terminal device driver.
  36  */
  37 
  38 #include <sys/types.h>
  39 #include <sys/param.h>
  40 #include <sys/stream.h>
  41 #include <sys/stropts.h>
  42 #include <sys/strsun.h>
  43 #include <sys/termio.h>
  44 #include <sys/pcb.h>
  45 #include <sys/signal.h>
  46 #include <sys/cred.h>
  47 #include <sys/strtty.h>
  48 #include <sys/errno.h>
  49 #include <sys/cmn_err.h>
  50 #include <sys/jioctl.h>
  51 #include <sys/ptem.h>
  52 #include <sys/ptms.h>
  53 #include <sys/debug.h>
  54 #include <sys/kmem.h>
  55 #include <sys/ddi.h>
  56 #include <sys/sunddi.h>
  57 #include <sys/conf.h>
  58 #include <sys/modctl.h>
  59 
  60 extern struct streamtab pteminfo;
  61 
  62 static struct fmodsw fsw = {
  63         "ptem",
  64         &pteminfo,
  65         D_MTQPAIR | D_MP
  66 };
  67 
  68 static struct modlstrmod modlstrmod = {
  69         &mod_strmodops, "pty hardware emulator", &fsw
  70 };
  71 
  72 static struct modlinkage modlinkage = {
  73         MODREV_1, &modlstrmod, NULL
  74 };
  75 
  76 int
  77 _init()
  78 {
  79         return (mod_install(&modlinkage));
  80 }
  81 
  82 int
  83 _fini()
  84 {
  85         return (mod_remove(&modlinkage));
 
 | 
 
 
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  23 /*        All Rights Reserved   */
  24 
  25 
  26 /*
  27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28  * Use is subject to license terms.
  29  * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
  30  */
  31 
  32 /*
  33  * Description:
  34  *
  35  * The PTEM streams module is used as a pseudo driver emulator.  Its purpose
  36  * is to emulate the ioctl() functions of a terminal device driver.
  37  */
  38 
  39 #include <sys/types.h>
  40 #include <sys/param.h>
  41 #include <sys/stream.h>
  42 #include <sys/stropts.h>
  43 #include <sys/strsun.h>
  44 #include <sys/termio.h>
  45 #include <sys/pcb.h>
  46 #include <sys/signal.h>
  47 #include <sys/cred.h>
  48 #include <sys/strtty.h>
  49 #include <sys/errno.h>
  50 #include <sys/cmn_err.h>
  51 #include <sys/jioctl.h>
  52 #include <sys/ptem.h>
  53 #include <sys/ptms.h>
  54 #include <sys/debug.h>
  55 #include <sys/kmem.h>
  56 #include <sys/ddi.h>
  57 #include <sys/sunddi.h>
  58 #include <sys/conf.h>
  59 #include <sys/modctl.h>
  60 
  61 extern struct streamtab pteminfo;
  62 
  63 static struct fmodsw fsw = {
  64         "ptem",
  65         &pteminfo,
  66         D_MTQPAIR | D_MP | _D_SINGLE_INSTANCE
  67 };
  68 
  69 static struct modlstrmod modlstrmod = {
  70         &mod_strmodops, "pty hardware emulator", &fsw
  71 };
  72 
  73 static struct modlinkage modlinkage = {
  74         MODREV_1, &modlstrmod, NULL
  75 };
  76 
  77 int
  78 _init()
  79 {
  80         return (mod_install(&modlinkage));
  81 }
  82 
  83 int
  84 _fini()
  85 {
  86         return (mod_remove(&modlinkage));
 
 |