OSDN Git Service

c9e8a9037d8c266918896dcaa17cc89e0b410d4f
[linuxjm/LDP_man-pages.git] / release / man3 / posix_openpt.3
1 .\" Copyright (C) 2004 Michael Kerrisk
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH POSIX_OPENPT 3 2012\-04\-20 "" "Linux Programmer's Manual"
31 .SH 名前
32 posix_openpt \- 疑似端末 (pseudoterminal) デバイスをオープンする
33 .SH 書式
34 .nf
35 \fB#include <stdlib.h>\fP
36 \fB#include <fcntl.h>\fP
37 .sp
38 \fBint posix_openpt(int \fP\fIflags\fP\fB);\fP
39 .fi
40 .sp
41 .in -4n
42 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
43 .in
44 .sp
45 .ad l
46 \fBposix_openpt\fP(): _XOPEN_SOURCE\ >=\ 600
47 .ad b
48 .SH 説明
49 \fBposix_openpt\fP()  関数は使用されていない疑似端末マスタデバイスをオープンし、
50 そのデバイスを参照するために使うファイルディスクリプタを返す。
51
52 \fIflags\fP 引き数は、以下のフラグのうち 0 個以上の OR をとったビットマスクである。
53 .TP 
54 \fBO_RDWR\fP
55 読み書きのためにデバイスをオープンする。 普通はこのフラグを指定する。
56 .TP 
57 \fBO_NOCTTY\fP
58 このデバイスをプロセスの制御端末としない。
59 .SH 返り値
60 成功した場合、 \fBposix_openpt\fP()  は負ではないファイルディスクリプタを返す。
61 これは使用されていないディスクリプタのうち最小の値である。 失敗した場合、\-1 が返されて、エラーを示すために \fIerrno\fP が設定される。
62 .SH エラー
63 \fBopen\fP(2)  を参照すること。
64 .SH バージョン
65 \fBposix_openpt\fP()  の glibc でのサポートはバージョン 2.2.1 以降で提供されている。
66 .SH 準拠
67 \fBposix_openpt\fP()  は UNIX 98 疑似端末サポート (\fBpts\fP(4)  を参照) の一部である。 この関数は
68 POSIX.1\-2001 で指定されている。
69 .SH 注意
70 \fBposix_openpt\fP() 関数は POSIX において最近作られたものである。
71 System V (別名 UNIX 98) 疑似端末をサポートする UNIX 実装の中には、
72 この関数を持たないものもあるが、以下のようにして簡単に実装できる:
73 .in +4n
74 .nf
75
76 int
77 posix_openpt(int flags)
78 {
79     return open("/dev/ptmx", flags);
80 }
81 .fi
82 .in
83 .PP
84 \fBposix_openpt\fP() を呼び出すと、対応する擬似端末スレーブデバイスのパス
85 名が生成される。スレーブデバイスのパス名は \fBptsname\fP(3) を使って取得
86 できる。スレーブデバイスのパス名はマスターデバイスがオープンされている
87 間だけ存在する。
88 .SH 関連項目
89 \fBopen\fP(2), \fBgetpt\fP(3), \fBgrantpt\fP(3), \fBptsname\fP(3), \fBunlockpt\fP(3),
90 \fBpts\fP(4), \fBpty\fP(7)
91 .SH この文書について
92 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
93 である。プロジェクトの説明とバグ報告に関する情報は
94 http://www.kernel.org/doc/man\-pages/ に書かれている。