1 .\" Copyright (c) OpenBSD Group
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" Converted into a manpage again by Martin Schulze <joey@infodrom.org>
30 .\" Added -lutil remark, 030718
32 .\" Japanese Version Copyright (c) 2002 Yuichi SATO
33 .\" all rights reserved.
34 .\" Translated Tue Jan 22 21:42:05 JST 2002
35 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
36 .\" Updated Mon Mar 8 2003 by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
37 .\" Updated Sun Sep 14 2003 by Akihiro MOTOKI
40 .\"WORD: pseudoterminal 疑似端末
42 .TH OPENPTY 3 2010-06-13 "GNU" "Linux Programmer's Manual"
45 .\"O openpty, login_tty, forkpty \- tty utility functions
46 openpty, login_tty, forkpty \- 端末ユーティリティ関数
52 .BI "int openpty(int *" amaster ", int *" aslave ", char *" name ,
53 .BI " const struct termios *" termp ,
54 .BI " const struct winsize *" winp );
56 .BI "pid_t forkpty(int *" amaster ", char *" name ,
57 .BI " const struct termios *" termp ,
58 .BI " const struct winsize *" winp );
62 .BI "int login_tty(int " fd );
64 .\"O Link with \fI\-lutil\fP.
71 .\"O function finds an available pseudoterminal and returns file descriptors
72 .\"O for the master and slave in
77 関数は、使用可能な疑似端末 (pseudoterminal) を見つけて、
78 マスタとスレーブのファイル・ディスクリプタを
85 .\"O is not NULL, the filename of the slave is returned in
88 が NULL でない場合、スレーブのファイル名が
93 .\"O is not NULL, the terminal parameters of the slave will be set to the
97 が NULL でない場合、スレーブの端末パラメータは
102 .\"O is not NULL, the window size of the slave will be set to the values in
105 が NULL でない場合、スレーブのウインドウサイズは
110 .\"O .BR login_tty ()
111 .\"O function prepares for a login on the tty
113 .\"O (which may be a real tty device, or the slave of a pseudoterminal as
116 .\"O by creating a new session, making
118 .\"O the controlling terminal for the calling process, setting
120 .\"O to be the standard input, output, and error streams of the current
121 .\"O process, and closing
134 呼び出し元の標準入力・標準出力・標準エラーのストリームを
142 .\"O function combines
146 .\"O .BR login_tty ()
147 .\"O to create a new process operating in a pseudoterminal.
153 を組み合わせ、疑似端末を操作する新しいプロセスを生成する。
155 .\"O descriptor of the master side of the pseudoterminal is returned in
157 .\"O and the filename of the slave in
159 .\"O if it is not NULL.
160 疑似端末のマスタ側のファイル・ディスクリプタは
164 が NULL でない場合には、スレーブのファイル名が
171 .\"O arguments, if not NULL,
172 .\"O will determine the terminal attributes and window size of the slave
173 .\"O side of the pseudoterminal.
178 疑似端末のスレーブ側の端末属性とウインドウサイズを決定する。
179 .\"O .SH "RETURN VALUE"
183 .\"O .BR login_tty (),
186 .\"O is not successful, \-1 is returned and
188 .\"O is set to indicate the error.
198 .\"O .BR login_tty (),
199 .\"O and the child process of
201 .\"O return 0, and the parent process of
203 .\"O returns the process ID of the child process.
211 の親プロセスは子プロセスのプロセス ID を返す。
221 .\"O There are no available ttys.
224 .\"O .BR login_tty ()
229 .\"O to the controlling terminal of the calling process.
233 を呼び出し元のプロセスの制御端末に設定するのに失敗した場合、
238 .\"O will fail if either
249 .\"O .SH "CONFORMING TO"
251 .\"O These are BSD functions, present in libc5 and glibc2.
252 .\"O They are not standardized in POSIX.
253 これらは BSD の関数であり、libc5 と glibc2 に存在する。
257 .\"O .\" These functions are included in libutil, hence you'll need to add
259 .\"O .\" to your compiler command line.
260 .\" これらの関数は libutil に含まれている。したがって、コンパイル時の
267 .\"O modifiers were added to the structure pointer arguments of
280 .\"O In versions of glibc before 2.0.92,
282 .\"O returns file descriptors for a BSD pseudoterminal pair;
283 .\"O since glibc 2.0.92,
284 .\"O it first attempts to open a Unix 98 pseudoterminal pair,
285 .\"O and falls back to opening a BSD pseudoterminal pair if that fails.
286 2.0.92 より前のバージョンの glibc では、
288 は BSD 疑似端末ペアのファイル・ディスクリプタを返す。
291 はまず Unix 98 疑似端末ペアをオープンしようとし、それに失敗した場合に
292 BSD 疑似端末ペアのオープンへと移行する。
295 .\"O Nobody knows how much space should be reserved for
299 に対してどのくらい大きさを予約しておけばいいか分からない。
306 .\"O may not be secure.