ptmx

ptmx

DESCRIPTION
The file /dev/ptmx is a character file with major number 5 and minor
number 2, usually of mode 0666 and owner.group of root.root. It is
used to create a pseudo-terminal master and slave pair.

When a process opens /dev/ptmx, it gets a file descriptor for a pseudo-
terminal master (PTM), and a pseudo-terminal slave (PTS) device is cre-
ated in the /dev/pts directory. Each file descriptor obtained by open-
ing /dev/ptmx is an independent PTM with its own associated PTS, whose
path can be found by passing the descriptor to ptsname(3).

Before opening the pseudo-terminal slave, you must pass the master‘s
file descriptor to grantpt(3) and unlockpt(3).

Once both the pseudo-terminal master and slave are open, the slave pro-
vides processes with an interface that is identical to that of a real
terminal.

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.

In practice, pseudo-terminals are used for implementing terminal emula-
tors such as xterm(1), in which data read from the pseudo-terminal mas-
ter is interpreted by the application in the same way a real terminal
would interpret the data, and for implementing remote-login programs
such as sshd(8), in which data read from the pseudo-terminal master is
sent across the network to a client program that is connected to a ter-
minal or terminal emulator.

Pseudo-terminals can also be used to send input to programs that nor-
mally refuse to read input from pipes (such as su(1), and passwd(1)).

FILES
/dev/ptmx, /dev/pts/*

NOTES
The Linux support for the above (known as Unix98 pty naming) is done
using the devpts file system, that should be mounted on /dev/pts.

Before this Unix98 scheme, master ptys were called /dev/ptyp0, ... and
slave ptys /dev/ttyp0, ... and one needed lots of preallocated device
nodes.

SEE ALSO
getpt(3), grantpt(3), ptsname(3), unlockpt(3), pty(7)

COLOPHON
This page is part of release 3.23 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.

ptmx

时间: 2024-10-23 08:16:06

ptmx的相关文章

[fw]Linux下tty/pty/pts/ptmx详解

基本概念: 1> tty(终端设备的统称):tty一词源于Teletypes,或者teletypewriters,原来指的是电传打字机,是通过串行线用打印机键盘通过阅读和发送信息的东西,后来这东西被键盘与显示器取代,所以现在叫终端比较合适.终端是一种字符型设备,它有多种类型,通常使用tty来简称各种类型的终端设备. 2> pty(虚拟终端):但是如果我们远程telnet到主机或使用xterm时不也需要一个终端交互么?是的,这就是虚拟终端pty(pseudo-tty) 3> pts/ptm

使用busybox制作rootfs

Build Busybox as a static binary(no shared libs),如果选择上,则busybox将以静态形式进行编译,否则将以动态方式编译.此外,还需要对交叉编译环境进行配置,选择其中的Cross Compiler Perfix,输入交叉编译器的前缀,我们的嵌入式平台上使用的是arm-uclinux-linu TAG: busybox  rootfs 1  获取源码解压 从busybox的官方主页http://www.busybox.net ,下载busybox的源

[Linux学习笔记] Linux常用命令 - 用户版本信息查看

用户版本信息查看 1. 查看当前系统用户登录信息: who 命令名称: who 命令所在路径: /usr/bin/who 执行权限: 所有用户 语法: who 功能描述: 查看当前系统用户登录信息 补充: w命令提供了较who命令更强大的功能 2. 查看当前用户身份: whoami 命令名称: whoami 命令所在路径: /usr/bin/whoami 执行权限: 所有用户 语法: whoami 功能描述: 查看当前用户身份 3. 查看系统版本信息: uname 命令名称: uname 命令所

linux 系统 /proc

1. /proc目录Linux 内核提供了一种通过 /proc 文件系统,在运行时访问内核内部数据结构.改变内核设置的机制.proc文件系统是一个伪文件系统,它只存在内存当中,而不占用外存空间.它以文件系统的方式为访问系统内核数据的操作提供接口. 用户和应用程序可以通过 proc得到系统的信息,并可以改变内核的某些参数.由于系统的信息,如进程,是动态改变的,所以用户或应用程序读取proc文件时,proc文件系统是 动态从系统内核读出所需信息并提交的.下面列出的这些文件或子文件夹,并不是都是在你的

Linux课程第六天学习笔记

##################################    12.不同系统之间的文件传输    ################################## ####################[[email protected] Desktop]# scp -r /etc/ [email protected]:/mnt/    ##"-r"拷贝目录[email protected]'s password: ......                  

移植Openssh到开发板

1.下载源码 zlib,openssl , openssh,配置编译链,编译,安装.大致的配置如下: 编译zlib./configure --prefix=/home/potato/openssl/install/zlib-1.2.3make make install 编译openssl./Configure --prefix=/home/potato/openssl/install/openssl-0.9.8e  os/compiler:arm-linux-gccmake make insta

RHEL7基本命令操作

注意事项: [[email protected] ~]# df -h | grep sr0 /dev/sr0               3.8G  3.8G    0 100% /mnt 如果查看到的结果不是/mnt,则执行卸载命令,先进行卸载 [[email protected] ~]#umount /dev/sr0   [[email protected] ~]# echo "/dev/sr0 /mnt iso9660  defaults  0 0" >>  /etc

tty/pts 相关指令

http://unix.stackexchange.com/questions/136662/how-can-we-know-whos-at-the-other-end-of-a-pseudo-terminal-device stty -F /dev/pts/2 ls /proc/29864/fd/* -lstrace -p 29864 |lessls /proc/locksls /proc/locks -lls /proc/tty/driverscat /proc/tty/driverssud

系统时间错误导致make命令实际在循环执行configure命令

特征屏幕轮番出现checking的字符基本可以确定系统时间是有问题: checking for --enable-universalsdk... no  checking for --with-universal-archs... 32-bit  checking MACHDEP... linux2  checking EXTRAPLATDIR...   checking machine type as reported by uname -m... i686  checking for --w