svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
ptm(4d)
ptm(4D) Device Drivers & /dev files ptm(4D)
NAME
ptm - STREAMS pseudo-tty manager driver
DESCRIPTION
The pseudo-tty subsystem simulates a terminal connection, where the
manager side represents the terminal and the subsidiary represents the
user process's special device end point. The manager device is set up
as a cloned device where its major device number is the major for the
clone device and its minor device number is the major for the ptm dri‐
ver. There are no nodes in the file system for manager devices. The
manager pseudo driver is opened using the open(2) system call with
/dev/ptmx as the device parameter. The clone open finds the next avail‐
able minor device for the ptm major device.
A manager device is available only if it and its corresponding sub‐
sidiary device are not already open. When the manager device is opened,
the corresponding subsidiary device is automatically locked out. Only
one open is allowed on a manager device. Multiple opens are allowed on
the subsidiary device. After both the manager and subsidiary have been
opened, the user has two file descriptors which are the end points of a
full duplex connection composed of two streams which are automatically
connected at the manager and subsidiary drivers. The user may then push
modules onto either side of the stream pair.
The manager and subsidiary drivers pass all messages to their adjacent
queues. Only the M_FLUSH needs some processing. Because the read queue
of one side is connected to the write queue of the other, the FLUSHR
flag is changed to the FLUSHW flag and vice versa. When the manager de‐
vice is closed an M_HANGUP message is sent to the subsidiary device
which will render the device unusable. The process on the subsidiary
side gets the errno EIO when attempting to write on that stream but it
will be able to read any data remaining on the stream head read queue.
When all the data has been read, read() returns 0 indicating that the
stream can no longer be used. On the last close of the subsidiary de‐
vice, a 0-length message is sent to the manager device. When the appli‐
cation on the manager side issues a read() or getmsg() and 0 is re‐
turned, the user of the manager device decides whether to issue a
close() that dismantles the pseudo-terminal subsystem. If the manager
device is not closed, the pseudo-tty subsystem will be available to an‐
other user to open the subsidiary device.
If O_NONBLOCK or O_NDELAY is set, read on the manager side returns −1
with errno set to EAGAIN if no data is available, and write returns −1
with errno set to EAGAIN if there is internal flow control.
IOCTLS
The manager driver supports the ISPTM and UNLKPT ioctls that are used
by the functions grantpt(3C), unlockpt(3C), and ptsname(3C). The ioctl
ISPTM determines whether the file descriptor is that of an open manager
device. On success, it returns the 0. The ioctl UNLKPT unlocks the man‐
ager and subsidiary devices. It returns 0 on success. On failure, the
errno is set to EINVAL indicating that the manager device is not open.
FILES
/dev/ptmx manager clone device
/dev/pts/N subsidiary devices (N = 1 -> number of ptys available)
SEE ALSO
grantpt(3C), ptsname(3C), unlockpt(3C), pts(4D), pckt(4M)
STREAMS Programming Guide
Oracle Solaris 11.4 Tunable Parameters Reference Manual
NOTES
In previous releases and earlier standards, manager devices were re‐
ferred to as "master" devices. This release has adopted the "manager"
terminology used in the POSIX.1-2024 and The Open Group Standard Base
Specifications, Issue 8 standards.
Oracle Solaris 11.4 19 Jun 2024 ptm(4D)