1 .\" Copyright (c) 1993 Michael Haardt (michael@moria.de),
2 .\" Fri Apr 2 11:32:09 MET DST 1993
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, write to the Free
21 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
24 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
25 .\" Modified 2003-04-07 by Michael Kerrisk
27 .\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi
28 .\" all rights reserved.
29 .\" Translated Tue Feb 6 16:57:03 JST 1997
30 .\" by ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
31 .\" Modified Thu Feb 5 17:28:31 JST 1998
32 .\" by ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
33 .\" Updated Fri Aug 16 00:04:53 JST 2002
34 .\" by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\" WORD: terminal üËö
37 .\" WORD: process ¥×¥í¥»¥¹
38 .\" WORD: controlling terminal À©¸æüËö
39 .\" WORD: file descriptor ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
41 .TH TTY 4 2003-04-07 "Linux" "Linux Programmer's Manual"
43 .\"O tty \- controlling terminal
48 .\"O The file \fI/dev/tty\fP is a character file with major number 5 and
49 .\"O minor number 0, usually of mode 0666 and owner.group root.tty.
50 .\"O It is a synonym for the controlling terminal of a process, if any.
51 \fI/dev/tty\fP ¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥¸¥ã¡¼ÈÖ¹æ 5¡¢¥Þ¥¤¥Ê¡¼ÈÖ¹æ 0 ¤Î¥¥ã¥é¥¯¥¿¡¼
52 ¥Ç¥Ð¥¤¥¹¤Ç¤¢¤ë¡£Ä̾¤½¤Î¥â¡¼¥É¤Ï 0666¡¢¥ª¡¼¥Ê.¥°¥ë¡¼¥×¤Ï root.tty ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
53 ¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤¬Â¸ºß¤¹¤ë¾ì¹ç¡¢¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥»¥¹¤ÎÀ©¸æüËö¤È
56 .\"O In addition to the
58 .\"O requests supported by the device that
59 .\"O \fBtty\fP refers to, the
61 .\"O request \fBTIOCNOTTY\fP is supported.
62 \fBtty\fP ¤¬»²¾È¤·¤Æ¤¤¤ë¥Ç¥Ð¥¤¥¹¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë
67 Í×µá \fBTIOCNOTTY\fP ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
69 .\"O Detach the calling process from its controlling terminal.
70 ¸Æ¤Ó½Ð¤·¸µ¤Î¥×¥í¥»¥¹¤ò¤½¤ÎÀ©¸æüËö¤«¤éÀÚ¤êÎ¥¤¹¡£
72 .\"O If the process is the session leader,
77 .\"O signals are sent to the foreground process group
78 .\"O and all processes in the current session lose their controlling tty.
79 ¤½¤Î¥×¥í¥»¥¹¤¬¥»¥Ã¥·¥ç¥ó¡¦¥ê¡¼¥À¡¼ (session leader) ¤Î¾ì¹ç¡¢
84 ¤¬¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦¥×¥í¥»¥¹¡¦¥°¥ë¡¼¥×¤ËÁ÷¤é¤ì¡¢
85 ¥«¥ì¥ó¥È¡¦¥»¥Ã¥·¥ç¥ó¤Ë°¤¹Á´¤Æ¤Î¥×¥í¥»¥¹¤Ë¤Ä¤¤¤Æ³Æ¡¹¤ÎÀ©¸æüËö¤¬ÀÚ¤êÎ¥¤µ¤ì¤ë¡£
89 .\"O call only works on file descriptors connected
90 .\"O to \fI/dev/tty\fP.
91 .\"O It is used by daemon processes when they are invoked
92 .\"O by a user at a terminal.
93 .\"O The process attempts to open \fI/dev/tty\fP.
94 .\"O If the open succeeds, it
95 .\"O detaches itself from the terminal by using \fBTIOCNOTTY\fP, while if the
96 .\"O open fails, it is obviously not attached to a terminal and does not need
97 .\"O to detach itself.
100 ¸Æ¤Ó½Ð¤·¤Ï \fI/dev/tty\fP ¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤¿¥Õ¥¡¥¤¥ë¡¦
101 ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë¤Î¤ßºîÍѤ¹¤ë¡£¤³¤Îµ¡Ç½¤Ï¡¢¥æ¡¼¥¶¤Ë¤è¤Ã¤ÆüËö¤«¤é
102 µ¯Æ°¤µ¤ì¤¿¥Ç¡¼¥â¥ó¥×¥í¥»¥¹¤Ë¤è¤ê»ÈÍѤµ¤ì¤ë¡£
103 ¤½¤Î¥×¥í¥»¥¹¤Ï \fI/dev/tty\fP ¤ò¥ª¡¼¥×¥ó¤·¤è¤¦¤È»î¤ß¤ë¡£
104 ¥ª¡¼¥×¥ó¤ËÀ®¸ù¤¹¤ë¤È¡¢¤½¤Î¥×¥í¥»¥¹¤Ï \fBTIOCNOTTY\fP ¤ò»È¤Ã¤Æ
105 ¼«Ê¬¼«¿È¤òüËö¤«¤éÀÚ¤êÎ¥¤¹¡£¥ª¡¼¥×¥ó¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢¤½¤Î¥×¥í¥»¥¹¤¬
106 üËö¤Ë·ë¤Ó¤Ä¤±¤é¤ì¤Æ¤¤¤Ê¤¤¤Î¤ÏÌÀ¤é¤«¤Ç¤¢¤ê¡¢¼«¿È¤òüËö¤«¤éÀÚ¤êÎ¥¤¹