1.\" $NetBSD: ptm.4,v 1.6 2008/05/08 15:34:21 wiz Exp $ 2.\" 3.\" Copyright (c) 2004 Thomas Klausner 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd November 12, 2005 27.Dt PTM 4 28.Os 29.Sh NAME 30.Nm ptm 31.Nd pseudo-terminal multiplexor device 32.Sh SYNOPSIS 33.Cd pseudo-device pty Op Ar count 34.Sh DESCRIPTION 35The 36.Nm 37driver is the backend for the 38.Pa /dev/ptm 39device. 40It supports three 41.Xr ioctl 2 Ns s . 42The first is 43.Dv TIOCPTMGET , 44which allocates a free pseudo-terminal device, sets its user ID to 45the calling user, 46.Xr revoke 2 Ns s 47it, and returns the opened file descriptors for both the master 48and the slave pseudo-terminal device to the caller in a 49.Va struct ptmget . 50This struct has the following content: 51.Bd -literal -offset indent 52struct ptmget { 53 int cfd; 54 int sfd; 55 char cn[16]; 56 char sn[16]; 57}; 58.Ed 59.Pp 60where 61.Va cfd 62and 63.Va sfd 64contain the master resp. slave device's file descriptor and 65.Va cn 66and 67.Va sn 68the corresponding paths in the file system. 69.Pp 70The 71.Pa /dev/ptmx 72device supports two more 73.Xr ioctl 2 Ns s , 74.Dv TIOCGRANTPT , 75which is used by 76.Xr grantpt 3 , 77.Dv TIOCPTSNAME , 78which is used by 79.Xr ptsname 3 . 80.Pp 81The 82.Nm 83device is included with the pseudo-device 84.Xr pty 4 . 85It can be disabled by adding 86.Dq Cd options NO_DEV_PTM 87to the kernel configuration. 88.Sh FILES 89.Bl -tag 90.It Pa /dev/ptm 91.Nm 92access device 93.It Pa /dev/ptmx 94.Nm 95cloning device, used to implement Unix98 ptys 96.El 97.Sh SEE ALSO 98.Xr grantpt 3 , 99.Xr openpty 3 , 100.Xr posix_openpt 3 , 101.Xr ptsname 3 , 102.Xr unlockpt 3 , 103.Xr pty 4 104.Sh HISTORY 105The 106.Pa /dev/ptm 107device appeared in 108.Ox 3.5 109and was ported to 110.Nx 3.0 . 111