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的更多相关文章

  1. (从终端看linux-2)浅析terminal创建时ptmx和pts关系

    我们打开一个terminal,那么将会在devpts文件系统/dev/pts下创建一个对应的pts字符文件,该pts字符文件节点直接由/dev/ptmx节点的驱动函数ptmx_open()调用devp ...

  2. 【转】浅析terminal创建时ptmx和pts关系

      我们打开一个terminal,那么将会在devpts文件系统/dev/pts下创建一个对应的pts字符文件,该pts字符文件节点直接由/dev/ptmx节点的驱动函数ptmx_open()调用de ...

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

    基本概念: 1> tty(终端设备的统称):tty一词源于Teletypes,或者teletypewriters,原来指的是电传打字机,是通过串行线用打印机键盘通过阅读和发送信息的东西,后来这东 ...

  4. linux – tty,ttyS,pts,ptmx,vcs,vcsa设备文件之间的区别?(/dev/tty等)

    linux – tty,ttyS,pts,ptmx,vcs,vcsa设备文件之间的区别? 终端有字符终端和图形终端两种模式.在linux的图形环境下,我们可以通过鼠标点击来完成所有的管理任务,这是图形 ...

  5. Linux设备文件简介(转载)

    Linux 中的设备有2种类型:字符设备(无缓冲且只能顺序存取).块设备(有缓冲且可以随机存取).每个字符设备和块设备都必须有主.次设备号,主设备号相同的设 备是同类设备(使用同一个驱动程序).这些设 ...

  6. 破壳漏洞利用payload—shellshock in the wild

    FireEye关于破壳漏洞(shellshock)在现实中的利用有一篇文章: shellshock in the wild 原文较长,进行了对CGI利用的详细分析,笔者比较感兴趣的是Shellshoc ...

  7. Docker 从零开始制作基础镜像[centos]

    http://www.oschina.net/news/62897/docker-hub-contains-high-risk-vulnerabilities 这里有个统计,docker官方和个人发布 ...

  8. Strom的配置安装

    1.准备环境 1.1配置列表 配置项 版本信息 OS Red Hat   Enterprise Linux Server release 5.5 (Tikanga) IP 192.168.1.191/ ...

  9. Linux /dev目录详解和Linux系统各个目录的作用

    Linux /dev目录详解(转http://blog.csdn.net/maopig/article/details/7195048) 在linux下,/dev目录是很重要的,各种设备都在下面.下面 ...

随机推荐

  1. Uedit32_17.00 修改某一语言背景色-修改后续名后语法着色及某语言的大括号{}对齐

    修改UE的背景色:高级-配置-编辑器显示-其它-设置颜色 新增扩展名语法着色:如以tpl为后缀的html代码格式着色高级-配置-编辑器显示-语法着色-语言选言[选中要着色的语言html]-打开-在'F ...

  2. docker安装各种坑

    今天记录一下之前安装docker遇到的各种坑. 我们从http://mirrors.aliyun.com/docker-toolbox/windows/docker-toolbox/这个网站下载. 下 ...

  3. 一、Core的布局页、起始页及错误页

    一.布局页面: 使用布局页相当于一个母版页,可以将各个页面公用部分,如上方标题区.左侧导航菜单区.下方版权声明及状态显示区以及通用的js及css引用等,集中放到布局页管理,具体功能页面只需关注自己独有 ...

  4. Python开发—打包成exe

    pychaim下PyInstaller 打包 python程序 使用PyCharm开发python Pyinstaller打包jieba项目相关解决方案 Python打包成exe 一.安装pyinst ...

  5. python的list内存分配算法

    前提:python为了提高效率会为list预先分配一定的内存空间供其使用,避免在每次append等操作都去申请内存,下面简单分析下list的内存分配算法,主要就是两段. 1.当没有元素时,newsiz ...

  6. php session之redis存储

    前提:redis已安装好. php代码: <?php ini_set("session.save_handler", "redis"); ini_set( ...

  7. QTimer不能同时使用两个,用QTimerEvent (QT)

    最近写程序的时候有个界面想定两个QTimer定时器,不同时间干不同的事: QTimer *timer1 = new QTimer(this); QTimer *timer2 = new QTimer( ...

  8. CodeChef Max-digit Tree(动态规划)

    传送门. 题解: 最主要的问题是如何判断一个数是否合法,这就需要发现性质了. 这个状态划分还是不太容易想到, 每次加的数\(∈[0,k)\),也就是个位一直在变变变,更高的位每次都是加一,这启发我们状 ...

  9. Xcode模拟器快捷键

    command + 左右 = 横竖屏旋转 command + H + H = 切入层级后台模式

  10. Android逆向之旅---解析编译之后的Dex文件格式

    一.前言 新的一年又开始了,大家是否还记得去年年末的时候,我们还有一件事没有做,那就是解析Android中编译之后的classes.dex文件格式,我们在去年的时候已经介绍了: 如何解析编译之后的xm ...