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的更多相关文章
- (从终端看linux-2)浅析terminal创建时ptmx和pts关系
我们打开一个terminal,那么将会在devpts文件系统/dev/pts下创建一个对应的pts字符文件,该pts字符文件节点直接由/dev/ptmx节点的驱动函数ptmx_open()调用devp ...
- 【转】浅析terminal创建时ptmx和pts关系
我们打开一个terminal,那么将会在devpts文件系统/dev/pts下创建一个对应的pts字符文件,该pts字符文件节点直接由/dev/ptmx节点的驱动函数ptmx_open()调用de ...
- [fw]Linux下tty/pty/pts/ptmx详解
基本概念: 1> tty(终端设备的统称):tty一词源于Teletypes,或者teletypewriters,原来指的是电传打字机,是通过串行线用打印机键盘通过阅读和发送信息的东西,后来这东 ...
- linux – tty,ttyS,pts,ptmx,vcs,vcsa设备文件之间的区别?(/dev/tty等)
linux – tty,ttyS,pts,ptmx,vcs,vcsa设备文件之间的区别? 终端有字符终端和图形终端两种模式.在linux的图形环境下,我们可以通过鼠标点击来完成所有的管理任务,这是图形 ...
- Linux设备文件简介(转载)
Linux 中的设备有2种类型:字符设备(无缓冲且只能顺序存取).块设备(有缓冲且可以随机存取).每个字符设备和块设备都必须有主.次设备号,主设备号相同的设 备是同类设备(使用同一个驱动程序).这些设 ...
- 破壳漏洞利用payload—shellshock in the wild
FireEye关于破壳漏洞(shellshock)在现实中的利用有一篇文章: shellshock in the wild 原文较长,进行了对CGI利用的详细分析,笔者比较感兴趣的是Shellshoc ...
- Docker 从零开始制作基础镜像[centos]
http://www.oschina.net/news/62897/docker-hub-contains-high-risk-vulnerabilities 这里有个统计,docker官方和个人发布 ...
- Strom的配置安装
1.准备环境 1.1配置列表 配置项 版本信息 OS Red Hat Enterprise Linux Server release 5.5 (Tikanga) IP 192.168.1.191/ ...
- Linux /dev目录详解和Linux系统各个目录的作用
Linux /dev目录详解(转http://blog.csdn.net/maopig/article/details/7195048) 在linux下,/dev目录是很重要的,各种设备都在下面.下面 ...
随机推荐
- Nginx优化_压缩处理与内存缓存
对页面进行压缩处理; 服务器内存缓存. 1.对页面进行压缩处理 [root@proxy ~]# cat /usr/local/nginx/conf/nginx.conf http { ... gzip ...
- 编译安装github上的kafka_exporter项目
本文介绍的kafka_exporter是prometheus监控系统中针对kafka的一款监控插件,要使用这个监控插件,kafka的版本需要满足 0.10.1.0 及以上. 项目的github地址:h ...
- 使用BaGet来管理内部Nuget包
有的时候,我们想要制作一些nuget包,供自己内部调用,不想公开出去,那么就需要一个能够集中管理nuget包的服务了,今天我来给大家介绍一款轻便好用的包管理服务-----BaGet 下载并部署BaGe ...
- tf.cast()用法
把布尔类型转化成0和1类型,true是1,false是0反之,亦成立.
- 转义字符\e
Windows 平台下,conio.h 中有许多操作控制台颜色.格式的函数.但是再 Linux 平台下却没有类似的函数.经过在网上的一番搜索,找到了解决此问题的方法——转义字符\e.注意,\e这种写法 ...
- LeetCode--049--字母异位词分组(java)
给定一个字符串数组,将字母异位词组合在一起.字母异位词指字母相同,但排列不同的字符串. 示例: 输入: ["eat", "tea", "tan&quo ...
- LeetCode--047--全排列 II(java)
给定一个可包含重复数字的序列,返回所有不重复的全排列. 示例: 输入: [1,1,2] 输出: [ [1,1,2], [1,2,1], [2,1,1] ] 对比46题增加了used数组,判断该数上次是 ...
- java实现简单的控制台的计算器
要用面向对象的思维写. //我是代码的搬运工import java.util.Scanner;public class Main { public static void main(String[] ...
- Linux find过滤掉没有查看权限的文件
参考:https://blog.csdn.net/sinat_39416814/article/details/84993424 https://www.jianshu.com/p/2b056e1c0 ...
- MongoDB与阿里云达成战略合作,最新数据库独家上线阿里云!
11月26日,开源数据库厂商MongoDB与阿里云在北京达成战略合作,作为合作的第一步,最新版MongoDB 4.2数据库产品正式上线阿里云平台. 目前阿里云成为全球唯一可提供最新版MongoDB服务 ...