pty.4

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 4 代码 · 共 131 行

4
131
字号
.\" SCCSID: @(#)pty.4	3.1	11/24/87.TH pty 4.SH Namepty \- pseudoterminal driver.SH Syntax\fBpseudo-device pty[\|\fIn\fB\|]\fR.SH Description.NXR "pty interface".NXR "pseudoterminal interface".NXR "pseudoterminal" "defined".NXR "slave pseudoterminal" "defined".NXR "master pseudoterminal" "defined"The.PN ptydriver provides support for a device-pair termed a.I pseudoterminal.A pseudoterminal is a pair of character devices, a.I masterdevice and a.I slavedevice.  The slave device provides processes withan interface identicalto that described in .MS tty 4 .However, whereas all other devices that provide the interface described in .MS tty 4have a hardware device of some sort behind them, the slavedevice has, instead, another process manipulatingit through the master half of the pseudoterminal.That is, anything written on the master device isgiven to the slave device as input and anything writtenon the slave device is presented as input on the masterdevice.The slave device can be opened multiple times, while the masterhalf can be opened only once..PPIf no optional \fIn\fR value is given definingthe number of pseudoterminal pairs to be configured, 16 pseudoterminal pairs are configured.All pseudoterminal lines should have a corresponding entry in the/etc/ttys file.  This must be done to insure that logins that use pseudoterminals will be tracked in the utmp and wtmp files..PPThe following .PN ioctlcalls apply only to pseudoterminals:.NXR "pseudoterminal interface" "ioctl list".TPTIOCSTOPStops output to a terminal (for example, like typing CTRL/S).  Takesno parameter..TPTIOCSTARTRestarts output (stopped by TIOCSTOP or by typing CTRL/S).Takes no parameter..TPTIOCPKTEnable/disable .I packetmode.  Packet mode is enabled by specifying (by reference)a nonzero parameter and disabled by specifying (by reference)a zero parameter.  When applied to the master side of a pseudoterminal, each subsequent .PN read from the terminal will return data written on the slave part ofthe pseudoterminal preceded by a zero byte (symbolicallydefined as TIOCPKT_DATA), or a single byte reflecting controlstatus information.  In the latter case, the byte is an inclusive-orof zero or more of the bits:.RS.TPTIOCPKT_FLUSHREADwhenever the read queue for the terminal is flushed..TPTIOCPKT_FLUSHWRITEwhenever the write queue for the terminal is flushed..TPTIOCPKT_STOPwhenever output to the terminal is stopped by typing CTRL/S..TPTIOCPKT_STARTwhenever output to the terminal is restarted..TPTIOCPKT_DOSTOPwhenever the stop characteris CTRL/Sand the start characteris CTRL/Q..TPTIOCPKT_NOSTOPwhenever the start and stop characters are not CTRL/S and/or CTRL/Q..RE.IPThis mode is used by .MS rlogin 1cand.MS rlogind 8cto implement a remote-echoed, locally flow-controlled (using CTRL/Sor CTRL/Q, or both) remote login with proper back-flushing of output.It can be used by other similar programs..TPTIOCREMOTEA mode for the master half of a pseudoterminal, independentof TIOCPKT.  This mode causes input to the pseudoterminalto be flow controlled and not input edited (regardless of theterminal mode).  Each write to the control terminal producesa record boundary for the process reading the terminal.  Innormal usage, a write of data is like the data typed as a lineon the terminal; a write of 0 bytes is like typing an end-of-filecharacter.  TIOCREMOTE can be used when doing remote lineediting in a window manager, or whenever flow-controlled inputis required..TPTIOCMASTERAllows the master to have complete control over the pseudoterminal andcauses the slave side to sleep until the master relinquishes control.This is useful in preventing changes on the pseudoterminal fromgoing undetected and being reset by the master..SH Files.TP 15.PN /dev/pty??(master pseudoterminals).TP.PN /dev/tty??(slave pseudoterminals).SH See Alsotty(4), MAKEDEV(8)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?