pty terminal packet mode TIOCPKT

后端 未结 1 1952
悲哀的现实
悲哀的现实 2021-01-22 14:53

If I start a terminal, how do I know what mode it starts in? Who decides that? Can I start my terminal in packet mode i.e. TIOCPKT

I came across this Packet mode link wh

1条回答
  •  心在旅途
    2021-01-22 15:06

    The link you refer to is for SCO Unix, which has the STREAMS I/O subsystem. There is a pretty good overview of STREAMS here (its for Solaris, but same concepts apply to other *nixes).

    The manual page tells you that you have to push the pckt module onto the stream, which is done with an ioctl() call with the I_PUSH command. The first link above should make this concept clearer, as it describes how STREAMS works.

    But alas, Linux does not support STREAMS. To enable packet mode of a pty on linux, you call ioctl() with TIOCPKT as in the first link of yours.

    The default when you create a new pty is normal (non packet) mode.

    0 讨论(0)
提交回复
热议问题