PTS(4)
π PTS(4) π
okay so this is the Kernel Interfaces Manual page for pts, and bestie, it's giving pseudo-terminal driver energy. let's get into it π«Ά
β¨ NAME β¨
pts β pseudo-terminal driver
π DESCRIPTION π
so the pts driver is literally the support system for a device-pair called a pseudo-terminal. and what IS a pseudo-terminal? it's a pair of character devices: a master device and a slave device. iconic duo behavior π
the slave device gives a process an interface that's identical to the one described in tty(4). no cap. but here's the tea: every other device that provides the tty(4) interface has some kind of actual hardware sitting behind it. the slave device? nope. instead, it has another process manipulating it through the master half of the pseudo-terminal. that's the whole vibe.
so like, anything written on the master device gets handed to the slave device as input, and anything written on the slave device gets presented as input on the master device. it's a two-way mirror situation πͺβ¨
πΈ the ioctl(2) calls that apply ONLY to pseudo-terminals πΈ
these ones are exclusive, they don't do this for just anybody:
TIOCPKTβ turns packet mode on/off. you enable it by specifying (by reference) a nonzero parameter, and disable it by specifying (by reference) a zero parameter. when you apply it to the master side of a pseudo-terminal, every subsequentread(2)from the terminal returns either:- data written on the slave part of the pseudo-terminal, preceded by a zero byte (symbolically defined as
TIOCPKT_DATA), or - a single byte reflecting control status information.
- data written on the slave part of the pseudo-terminal, preceded by a zero byte (symbolically defined as
in that second case, the byte is an inclusive-or of zero or more of these bits:
TIOCPKT_FLUSHREADβ whenever the read queue for the terminal is flushed.TIOCPKT_FLUSHWRITEβ whenever the write queue for the terminal is flushed.TIOCPKT_STOPβ whenever output to the terminal is stopped a la'^S'.TIOCPKT_STARTβ whenever output to the terminal is restarted.TIOCPKT_DOSTOPβ wheneverVSTOPis'^S'andVSTARTis'^Q'.TIOCPKT_NOSTOPβ whenever the start and stop characters are not'^S/^Q'.
while this mode is in use, the presence of control status information to be read from the master side may be detected by a select(2) for exceptional conditions. π
this mode is used by rlogin(1) and rlogind(8) to implement a remote-echoed, locally '^S/^Q' flow-controlled remote login with proper back-flushing of output. it can be used by other similar programs too, it's not gatekept π«Ά
TIOCGPTNβ obtain the device unit number, which can be used to generate the filename of the pseudo-terminal slave device. but wait β thisioctl(2)should not be used directly. instead, theptsname(3)function should be used. okay?? don't be messy πTIOCPTMASTERβ determine whether the file descriptor is pointing to a pseudo-terminal master device. and again, thisioctl(2)should not be used directly β it's used to implement routines likegrantpt(3). let the library do its thing, bestie π
π FILES π
the files used by this pseudo-terminals implementation are:
/dev/pts/[num]β pseudo-terminal slave devices.
π©Ί DIAGNOSTICS π©Ί
None.
(yeah. nothing. silence. the healthiest manpage section fr fr π)
π SEE ALSO π
π HISTORY π
a pseudo-terminal driver appeared in 4.2BSD. then in FreeBSD 8.0, it was replaced with the pts driver. glow-up era β¨π
and that's the whole page, bestie!! this one shipped from Debian, dated August 20, 2008 β so like, respect your elders, they've been slaying for a minute π«Άπ bye!!
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms