OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man4 / pts.4
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
3 .\" Notes added - aeb
4 .\" Redistribute and revise at will.
5 .\"
6 .\" Japanese Version Copyright (c) 2003  Akihiro MOTOKI
7 .\"         all rights reserved.
8 .\" Translated Tue Jul  8 00:28:17 JST 2003
9 .\"         by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
10 .\"
11 .\"WORD:        pseudoterminal          µ¼»÷üËö
12 .\"WORD:        pts                     µ¼»÷üËö
13 .\"
14 .TH PTS 4 2002-10-09 "Linux" "Linux Programmer's Manual"
15 .\"O .SH NAME
16 .SH Ì¾Á°
17 .\"O ptmx, pts \- pseudoterminal master and slave
18 ptmx, pts \- µ¼»÷üËö¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö
19 .\"O .SH DESCRIPTION
20 .SH ÀâÌÀ
21 .\"O The file \fI/dev/ptmx\fP is a character file with major number 5 and
22 .\"O minor number 2, usually of mode 0666 and owner.group of root.root.
23 .\"O It is used to create a pseudoterminal master and slave pair.
24 ¥Õ¥¡¥¤¥ë \fI/dev/ptmx\fP ¤Ï¡¢¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) 5¡¢
25 ¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼ (minor number) 2 ¤ò»ý¤Ä¥­¥ã¥é¥¯¥¿¡¦¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¡¢
26 Ä̾¥â¡¼¥É¤Ï 0666 ¤Ç¡¢½êÍ­¼Ô.¥°¥ë¡¼¥×¤Ï root.root ¤Ç¤¢¤ë¡£
27 ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢µ¼»÷üËö (pseudoterminal) ¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤Î
28 ¥Ú¥¢¤òºîÀ®¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¡£
29 .PP
30 .\"O When a process opens \fI/dev/ptmx\fP, it gets a file
31 .\"O descriptor for a pseudoterminal master (PTM),
32 .\"O and a pseudoterminal slave (PTS) device is created in the
33 .\"O .I /dev/pts
34 .\"O directory.
35 .\"O Each file descriptor obtained by opening \fI/dev/ptmx\fP
36 .\"O is an independent PTM with its own associated PTS, whose path can
37 .\"O be found by passing the descriptor to
38 .\"O .BR ptsname (3).
39 ¥×¥í¥»¥¹¤¬ \fI/dev/ptmx\fP ¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ë¤Ï
40 µ¼»÷üËö¥Þ¥¹¥¿ (pseudoterminal master; PTM) ¤Ø¤Î¥Õ¥¡¥¤¥ë¡¦
41 ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¡¢
42 .I /dev/pts
43 ¥Ç¥£¥ì¥¯¥È¥ê¤Ëµ¼»÷üËö¥¹¥ì¡¼¥Ö (pseudoterminal slave; PTS)
44 ¥Ç¥Ð¥¤¥¹¤¬ºîÀ®¤µ¤ì¤ë¡£
45 \fI/dev/ptmx\fP ¤ò¥ª¡¼¥×¥ó¤·¤ÆÆÀ¤é¤ì¤ë¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ï
46 ¤½¤ì¤¾¤ìÆÈΩ¤Î PTM ¤Ç¤¢¤ê¡¢Âбþ¤¹¤ë PTS ¤ò³Æ¡¹»ý¤Ä¡£
47 PTS ¤Î¥Ñ¥¹Ì¾¤Ï¡¢PTM ¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò
48 .BR ptsname (3)
49 ¤ËÅϤ¹¤ÈÃΤ뤳¤È¤¬¤Ç¤­¤ë¡£
50 .PP
51 .\"O Before opening the pseudoterminal slave, you must pass the master's file
52 .\"O descriptor to
53 .\"O .BR grantpt (3)
54 .\"O and
55 .\"O .BR unlockpt (3).
56 µ¼»÷üËö¥¹¥ì¡¼¥Ö¤ò¥ª¡¼¥×¥ó¤¹¤ëÁ°¤Ë¡¢É¬¤º¡¢¥Þ¥¹¥¿¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò
57 °ú¤­¿ô¤È¤·¤Æ
58 .BR grantpt (3)
59 ¤È
60 .BR unlockpt (3)
61 ¤ò¸Æ¤Ó½Ð¤µ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
62 .PP
63 .\"O Once both the pseudoterminal master and slave are open, the slave provides
64 .\"O processes with an interface that is identical to that of a real terminal.
65 µ¼»÷üËö¤Î¥Þ¥¹¥¿¤È¥¹¥ì¡¼¥Ö¤ÎξÊý¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿¸å¤Ï¡¢¥¹¥ì¡¼¥Ö¤Ï¡¢
66 ¥×¥í¥»¥¹¤ËÂФ·¤Æ¡¢¼ÂüËö (real terminal) ¤ÈÁ´¤¯Æ±¤¸¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ󶡤¹¤ë¡£
67 .PP
68 .\"O Data written to the slave is presented on the master descriptor as input.
69 .\"O Data written to the master is presented to the slave as input.
70 ¥¹¥ì¡¼¥Ö¤Ë½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¥Þ¥¹¥¿¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ëÆþÎϤȤ·¤Æ°·¤ï¤ì¡¢
71 ¥Þ¥¹¥¿¤Ë½ñ¤«¤ì¤¿¥Ç¡¼¥¿¤Ï¥¹¥ì¡¼¥Ö¤ËÂФ¹¤ëÆþÎϤȤ·¤Æ°·¤ï¤ì¤ë¡£
72 .PP
73 .\"O In practice, pseudoterminals are used for implementing terminal emulators
74 .\"O such as
75 .\"O .BR xterm (1),
76 .\"O in which data read from the pseudoterminal master is interpreted by the
77 .\"O application in the same way
78 .\"O a real terminal would interpret the data, and for implementing remote-login
79 .\"O programs such as
80 .\"O .BR sshd (8),
81 .\"O in which data read from the pseudoterminal master is sent across the network
82 .\"O to a client program that is connected to a terminal or terminal emulator.
83 ¼ÂÎã¤ò¤¢¤²¤ë¤È¡¢µ¼»÷üËö¤Ï
84 .BR xterm (1)
85 ¤Î¤è¤¦¤ÊüËö¥¨¥ß¥å¥ì¡¼¥¿¤ò¼ÂÁõ¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¡£
86 üËö¥¨¥ß¥å¥ì¡¼¥¿¤Ç¤Ï¡¢µ¼»÷üËö¤Î¥Þ¥¹¥¿¤«¤éÆɤ߹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢
87 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤È¤Ã¤Æ¼ÂüËö¤Î¥Ç¡¼¥¿¤ÈÁ´¤¯Æ±¤¸¤â¤Î¤Î¤è¤¦¤Ë¸«¤¨¤ë¡£
88 ¤Þ¤¿¡¢
89 .BR sshd (8)
90 ¤Î¤è¤¦¤Ê¥ê¥â¡¼¥È¡¦¥í¥°¥¤¥óÍÑ¤Î¥×¥í¥°¥é¥à¤Î¼ÂÁõ¤Ç¤Ï¡¢
91 µ¼»÷üËö¥Þ¥¹¥¿¤«¤éÆɤ߹þ¤Þ¤ì¤¿¥Ç¡¼¥¿¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤ò·Ðͳ¤·¤Æ¡¢
92 üËö¤äüËö¥¨¥ß¥å¥ì¡¼¥¿¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¡¦¥×¥í¥°¥é¥à¤ËÁ÷¿®¤µ¤ì¤ë¡£
93 .PP
94 .\"O Pseudoterminals can also be used to send input to programs that normally
95 .\"O refuse to read input from pipes (such as
96 .\"O .BR su (1),
97 .\"O and
98 .\"O .BR passwd (1)).
99 µ¼»÷üËö¤Ï¡¢
100 .RB ( su (1)
101 ¤ä
102 .BR passwd (1)
103 ¤Î¤è¤¦¤Ê) Ä̾ï¤Ï¥Ñ¥¤¥×¤«¤é¤ÎÆþÎϤòµñÈݤ¹¤ë¥×¥í¥°¥é¥à¤Ë¡¢
104 ÆþÎϤòÁ÷¿®¤¹¤ë¤¿¤á¤Ë¤â»ÈÍѤǤ­¤ë¡£
105 .\"O .SH FILES
106 .SH ¥Õ¥¡¥¤¥ë
107 .IR /dev/ptmx ,
108 .I /dev/pts/*
109 .\"O .SH NOTES
110 .SH È÷¹Í
111 .\"O The Linux support for the above (known as UNIX 98 pseudoterminal naming)
112 .\"O is done using the
113 .\"O .I devpts
114 .\"O file system, that should be mounted on
115 .\"O .IR /dev/pts .
116 (UNIX 98 pseudoterminal naming ¤È¸Æ¤Ð¤ì¤ë)
117 ¾åµ­¤Îµ¡Ç½¤Î Linux ¤Ç¤Î¥µ¥Ý¡¼¥È¤Ï¡¢Ä̾ï
118 .I /dev/pts
119 ¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤ë¤Ï¤º¤Î
120 .I devpts
121 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÄ̤·¤Æ¼Â¸½¤µ¤ì¤Æ¤¤¤ë¡¢
122 .LP
123 .\"O Before this UNIX 98 scheme, master pseudoterminals were called
124 .\"O .IR /dev/ptyp0 ", ..."
125 .\"O and slave pseudoterminals
126 .\"O .IR /dev/ttyp0 ", ..."
127 .\"O and one needed lots of preallocated device nodes.
128 ¤³¤Î UNIX 98 ¥¹¥­¡¼¥à¤¬Æ³Æþ¤µ¤ì¤ëÁ°¤Ï¡¢¥Þ¥¹¥¿µ¼»÷üËö¤Ï
129 .IR /dev/ptyp0 ", ..."
130 ¡¢¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ï
131 .IR /dev/ttyp0 ", ..."
132 ¤È¸Æ¤Ð¤ì¤Æ¤ª¤ê¡¢¤¢¤é¤«¤¸¤á¤¿¤¯¤µ¤ó¤Î¥Ç¥Ð¥¤¥¹¡¦¥Î¡¼¥É¤ò³ä¤êÅö¤Æ¤Æ
133 ¤ª¤¯É¬Íפ¬¤¢¤Ã¤¿¡£
134 .\"O .SH "SEE ALSO"
135 .SH ´ØÏ¢¹àÌÜ
136 .BR getpt (3),
137 .BR grantpt (3),
138 .BR ptsname (3),
139 .BR unlockpt (3),
140 .BR pty (7)