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. PHP实现session共享

    通过修改PHP-FPM配置文件,实现session会话共享: - 配置PHP使用memcached服务器共享Session信息 - 客户端访问两台不同的后端Web服务器时,Session 信息一致 环 ...

  2. md5sum 计算和校验文件的md5值

    1. 命令功能 md5算法一般用于检查文件完整性, 2. 语法格式 md5sum  [option]  [file] 参数 参数说明 -b 以二进制模式读入文件 -t 以文本模式读入文件 -c 用来从 ...

  3. 解压版(.zip)的MySQL数据库下载安装

    1.首先到mysql官网下载(https://dev.mysql.com/downloads/mysql/5.6.html#downloads): 2.解压下载好的压缩包文件,并将解压后的文件夹放到合 ...

  4. Less 混合(mixin)

    Less的混合:混合可以将一个定义好的class A轻松的引入到另一个class B中,从而简单实现class B继承class A中的所有属性.我们还可以带参数地调用,就像使用函数一样. .bord ...

  5. spark与Hadoop的区别

    1. Mapreduce和Spark的相同和区别 两者都是用mr模型来进行并行计算 hadoop的一个作业:job job分为map task和reduce task,每个task都是在自己的进程中运 ...

  6. proxyTable-后端代理-跨域请求数据

    config >>> index.js  配置 proxyTable: { '/api': { target:'https://api.jisuapi.com', // 你请求的第三 ...

  7. laravel后台账户登录验证(5.5.48版本)

    首先我是菜鸟,对laravel框架也不是很熟悉,突然有一天心血来潮就想研究一下laravel的后台登录用户登录的流程, 虽然公司项目中有这样的一套流程,也看了好几遍,越看越简单,越看我就越会了,当自己 ...

  8. ubuntu + JetSonNano+OpenCV3.4.8

    首先强调一点,如果要配置darknet环境,不建议安装该版本!!! 安装opencv前,建议先检测自己的系统是否已经装过其他版本, 检查方式: (1)查看是否安装opencv库: pkg-config ...

  9. 史上最全最实用HBuilder快捷键大全

    史上最全最实用HBuilder快捷键大全 一.文件操作二.编辑操作三.插入操作四.转义操作五.选择操作六.跳转操作七.查找操作八.运行九.视图一.文件操作新建菜单: ctrl + N新建: ctrl ...

  10. import的项目结构不对

    问题如下,在我们新导入一个maven项目时,碰到这样的目录结构,总有点别扭,而且在运行Tomcat的时候,突然发现build i选项下面少了两个我们经常使用的两个选项 window  --Perspe ...