OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / posix_openpt.3
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 2004 Michael Kerrisk
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .TH POSIX_OPENPT 3 2010\-10\-04 "" "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 この関数は POSIX において最近作られたものである。 System V (別名 UNIX 98) 疑似端末をサポートする UNIX 実装の中には、
71 この関数を持たないものもあるが、以下のようにして簡単に実装できる:
72 .in +4n
73 .nf
74
75 int
76 posix_openpt(int flags)
77 {
78     return open("/dev/ptmx", flags);
79 }
80 .fi
81 .in
82 .SH 関連項目
83 \fBopen\fP(2), \fBgetpt\fP(3), \fBgrantpt\fP(3), \fBptsname\fP(3), \fBunlockpt\fP(3),
84 \fBpts\fP(4), \fBpty\fP(7)