summaryrefslogtreecommitdiff
path: root/static/netbsd/man4/ptm.4 4.html
blob: 10fe5b3b1d05f68823990eff75db342254c11b72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<table class="head">
  <tr>
    <td class="head-ltitle">PTM(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">PTM(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">ptm</code> &#x2014;
    <span class="Nd">pseudo-terminal multiplexor device</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="Cd">pseudo-device pty</code></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">ptm</code> driver is the backend for the
    <span class="Pa">/dev/ptm</span> device. It supports three
    <a class="Xr">ioctl(2)</a>s. The first is
    <code class="Dv">TIOCPTMGET</code>, which allocates a free pseudo-terminal
    device, sets its user ID to the calling user, <a class="Xr">revoke(2)</a>s
    it, and returns the opened file descriptors for both the master and the
    slave pseudo-terminal device to the caller in a <var class="Va">struct
    ptmget</var>. This struct has the following content:</p>
<div class="Bd Pp Bd-indent Li">
<pre>struct ptmget {
        int     cfd;
        int     sfd;
        char    cn[PATH_MAX];
        char    sn[PATH_MAX];
};</pre>
</div>
<p class="Pp">where <var class="Va">cfd</var> and <var class="Va">sfd</var>
    contain the master resp. slave device's file descriptor and
    <var class="Va">cn</var> and <var class="Va">sn</var> the corresponding
    paths in the file system.</p>
<p class="Pp">The <span class="Pa">/dev/ptmx</span> device supports two more
    <a class="Xr">ioctl(2)</a>s, <code class="Dv">TIOCGRANTPT</code>, which is
    used by <a class="Xr">grantpt(3)</a>, <code class="Dv">TIOCPTSNAME</code>,
    which is used by <a class="Xr">ptsname(3)</a>.</p>
<p class="Pp">The <code class="Nm">ptm</code> device is included with the
    pseudo-device <a class="Xr">pty(4)</a>. It can be disabled by adding
    &#x201C;<code class="Cd">options NO_DEV_PTM</code>&#x201D; to the kernel
    configuration.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag">
  <dt><span class="Pa">/dev/ptm</span></dt>
  <dd><code class="Nm">ptm</code> access device</dd>
  <dt><span class="Pa">/dev/ptmx</span></dt>
  <dd><code class="Nm">ptm</code> cloning device, used to implement Unix98
    ptys</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">grantpt(3)</a>, <a class="Xr">openpty(3)</a>,
    <a class="Xr">posix_openpt(3)</a>, <a class="Xr">ptsname(3)</a>,
    <a class="Xr">unlockpt(3)</a>, <a class="Xr">pty(4)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <span class="Pa">/dev/ptm</span> device appeared in
    <span class="Ux">OpenBSD 3.5</span> and was ported to
    <span class="Ux">NetBSD 3.0</span>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">November 30, 2013</td>
    <td class="foot-os">NetBSD 10.1</td>
  </tr>
</table>