1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
4 .\" Redistribute and revise at will.
6 .TH PTS 4 2002-10-09 "Linux" "Linux Programmer's Manual"
8 ptmx, pts \- psuedoterminal master and slave
10 The file \fI/dev/ptmx\fP is a character file with major number 5 and
11 minor number 2, usually of mode 0666 and owner.group of root.root.
12 It is used to create a psuedoterminal master and slave pair.
14 When a process opens \fI/dev/ptmx\fP, it gets a file
15 descriptor for a psuedoterminal master (PTM),
16 and a psuedoterminal slave (PTS) device is created in the
19 Each file descriptor obtained by opening \fI/dev/ptmx\fP
20 is an independent PTM with its own associated PTS, whose path can
21 be found by passing the descriptor to
24 Before opening the psuedoterminal slave, you must pass the master's file
30 Once both the psuedoterminal master and slave are open, the slave provides
31 processes with an interface that is identical to that of a real terminal.
33 Data written to the slave is presented on the master descriptor as input.
34 Data written to the master is presented to the slave as input.
36 In practice, psuedoterminals are used for implementing terminal emulators
39 in which data read from the psuedoterminal master is interpreted by the
40 application in the same way
41 a real terminal would interpret the data, and for implementing remote-login
44 in which data read from the psuedoterminal master is sent across the network
45 to a client program that is connected to a terminal or terminal emulator.
47 Psuedoterminals can also be used to send input to programs that normally
48 refuse to read input from pipes (such as
56 The Linux support for the above (known as UNIX 98 psuedoterminal naming)
59 file system, that should be mounted on
62 Before this UNIX 98 scheme, master psuedoterminals were called
63 .IR /dev/ptyp0 ", ..."
64 and slave psuedoterminals
65 .IR /dev/ttyp0 ", ..."
66 and one needed lots of preallocated device nodes.