2004-11-03 13:51:07 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
|
|
|
|
.\" Notes added - aeb
|
|
|
|
.\" Redistribute and revise at will.
|
|
|
|
.\"
|
2007-05-18 09:11:21 +00:00
|
|
|
.TH PTS 4 2002-10-09 "Linux" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
ptmx, pts \- pseudoterminal master and slave
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
2005-11-02 13:55:25 +00:00
|
|
|
The file \fI/dev/ptmx\fP is a character file with major number 5 and
|
2004-11-03 13:51:07 +00:00
|
|
|
minor number 2, usually of mode 0666 and owner.group of root.root.
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
It is used to create a pseudoterminal master and slave pair.
|
2004-11-03 13:51:07 +00:00
|
|
|
.PP
|
2005-11-02 13:55:25 +00:00
|
|
|
When a process opens \fI/dev/ptmx\fP, it gets a file
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
descriptor for a pseudoterminal master (PTM),
|
|
|
|
and a pseudoterminal slave (PTS) device is created in the
|
2004-11-03 13:51:07 +00:00
|
|
|
.I /dev/pts
|
2007-04-12 22:42:49 +00:00
|
|
|
directory.
|
|
|
|
Each file descriptor obtained by opening \fI/dev/ptmx\fP
|
2004-11-03 13:51:07 +00:00
|
|
|
is an independent PTM with its own associated PTS, whose path can
|
|
|
|
be found by passing the descriptor to
|
|
|
|
.BR ptsname (3).
|
|
|
|
.PP
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
Before opening the pseudoterminal slave, you must pass the master's file
|
2004-11-03 13:51:07 +00:00
|
|
|
descriptor to
|
|
|
|
.BR grantpt (3)
|
|
|
|
and
|
|
|
|
.BR unlockpt (3).
|
|
|
|
.PP
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
Once both the pseudoterminal master and slave are open, the slave provides
|
2004-11-03 13:51:07 +00:00
|
|
|
processes with an interface that is identical to that of a real terminal.
|
|
|
|
.PP
|
|
|
|
Data written to the slave is presented on the master descriptor as input.
|
|
|
|
Data written to the master is presented to the slave as input.
|
|
|
|
.PP
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
In practice, pseudoterminals are used for implementing terminal emulators
|
2007-04-12 22:42:49 +00:00
|
|
|
such as
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR xterm (1),
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
in which data read from the pseudoterminal master is interpreted by the
|
2004-11-03 13:51:07 +00:00
|
|
|
application in the same way
|
|
|
|
a real terminal would interpret the data, and for implementing remote-login
|
|
|
|
programs such as
|
|
|
|
.BR sshd (8),
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
in which data read from the pseudoterminal master is sent across the network
|
2004-11-03 13:51:07 +00:00
|
|
|
to a client program that is connected to a terminal or terminal emulator.
|
|
|
|
.PP
|
2012-06-07 09:45:22 +00:00
|
|
|
Pseudoterminals can also be used to send input to programs that normally
|
2004-11-03 13:51:07 +00:00
|
|
|
refuse to read input from pipes (such as
|
2007-10-14 18:33:54 +00:00
|
|
|
.BR su (1),
|
2004-11-03 13:51:07 +00:00
|
|
|
and
|
2007-10-14 18:33:54 +00:00
|
|
|
.BR passwd (1)).
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH FILES
|
|
|
|
.IR /dev/ptmx ,
|
|
|
|
.I /dev/pts/*
|
|
|
|
.SH NOTES
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
The Linux support for the above (known as UNIX 98 pseudoterminal naming)
|
2004-11-03 13:51:07 +00:00
|
|
|
is done using the
|
|
|
|
.I devpts
|
2008-03-19 07:26:08 +00:00
|
|
|
file system, that should be mounted on
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR /dev/pts .
|
|
|
|
.LP
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
Before this UNIX 98 scheme, master pseudoterminals were called
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR /dev/ptyp0 ", ..."
|
open.2, poll.2, select_tut.2, getpt.3, openpty.3, posix_openpt.3, ptsname.3, unlockpt.3, pts.4, tty_ioctl.4, proc.5, pty.7: spfix: s/psuedoterminal/psuedoterminal/g
Reported-by: Denis Barbier <bouzim@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-13 03:32:15 +00:00
|
|
|
and slave pseudoterminals
|
2004-11-03 13:51:07 +00:00
|
|
|
.IR /dev/ttyp0 ", ..."
|
|
|
|
and one needed lots of preallocated device nodes.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR getpt (3),
|
|
|
|
.BR grantpt (3),
|
|
|
|
.BR ptsname (3),
|
2005-10-10 13:14:12 +00:00
|
|
|
.BR unlockpt (3),
|
|
|
|
.BR pty (7)
|