OSDN Git Service

064fe507d6b065ec1403f66515213b7d022d154b
[linuxjm/LDP_man-pages.git] / draft / 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 .\" Japanese Version Copyright (c) 2005 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated Sun Jan 30 08:55:16 JST 2005
28 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
29 .\"
30 .TH POSIX_OPENPT 3 2010-10-04 "" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH 名前
33 .\"O posix_openpt \- open a pseudoterminal device
34 posix_openpt \- 疑似端末 (pseudoterminal) デバイスをオープンする
35 .\"O .SH SYNOPSIS
36 .SH 書式
37 .nf
38 .B #include <stdlib.h>
39 .B #include <fcntl.h>
40 .sp
41 .BI "int posix_openpt(int " flags ");"
42 .fi
43 .sp
44 .in -4n
45 .\"O Feature Test Macro Requirements for glibc (see
46 .\"O .BR feature_test_macros (7)):
47 glibc 向けの機能検査マクロの要件
48 .RB ( feature_test_macros (7)
49 参照):
50 .in
51 .sp
52 .ad l
53 .BR posix_openpt ():
54 _XOPEN_SOURCE\ >=\ 600
55 .ad b
56 .\"O .SH DESCRIPTION
57 .SH 説明
58 .\"O The
59 .\"O .BR posix_openpt ()
60 .\"O function opens an unused pseudoterminal master device, returning a
61 .\"O file descriptor that can be used to refer to that device.
62 .BR posix_openpt ()
63 関数は使用されていない疑似端末マスタデバイスをオープンし、
64 そのデバイスを参照するために使うファイルディスクリプタを返す。
65 .\"O The
66 .\"O .I flags
67 .\"O argument is a bit mask that ORs together zero or more of
68 .\"O the following flags:
69 .I flags
70 引き数は、以下のフラグのうち 0 個以上の OR をとったビットマスクである。
71 .TP
72 .B O_RDWR
73 .\"O Open the device for both reading and writing.
74 .\"O It is usual to specify this flag.
75 読み書きのためにデバイスをオープンする。
76 普通はこのフラグを指定する。
77 .TP
78 .B O_NOCTTY
79 .\"O Do not make this device the controlling terminal for the process.
80 このデバイスをプロセスの制御端末としない。
81 .\"O .SH "RETURN VALUE"
82 .SH 返り値
83 .\"O On success,
84 .\"O .BR posix_openpt ()
85 .\"O returns a nonnegative file descriptor which is the lowest
86 .\"O numbered unused descriptor.
87 成功した場合、
88 .BR posix_openpt ()
89 は負ではないファイルディスクリプタを返す。
90 これは使用されていないディスクリプタのうち最小の値である。
91 .\"O On failure, \-1 is returned, and
92 .\"O .I errno
93 .\"O is set to indicate the error.
94 失敗した場合、\-1 が返されて、エラーを示すために
95 .I errno
96 が設定される。
97 .\"O .SH ERRORS
98 .SH エラー
99 .\"O See
100 .\"O .BR open (2).
101 .BR open (2)
102 を参照すること。
103 .\"O .SH VERSIONS
104 .SH バージョン
105 .\"O Glibc support for
106 .\"O .BR posix_openpt ()
107 .\"O has been provided since version 2.2.1.
108 .BR posix_openpt ()
109 の glibc でのサポートはバージョン 2.2.1 以降で提供されている。
110 .\"O .SH "CONFORMING TO"
111 .SH 準拠
112 .\"O .BR posix_openpt ()
113 .\"O is part of the UNIX 98 pseudoterminal support (see
114 .\"O .BR pts (4)).
115 .\"O This function is specified in POSIX.1-2001.
116 .BR posix_openpt ()
117 は UNIX 98 疑似端末サポート
118 .RB ( pts (4)
119 を参照) の一部である。
120 この関数は POSIX.1-2001 で指定されている。
121 .\"O .SH NOTES
122 .SH 注意
123 .\"O This function is a recent invention in POSIX.
124 .\"O Some UNIX implementations that support System V
125 .\"O (aka UNIX 98) pseudoterminals don't have this function, but it
126 .\"O is easy to implement:
127 この関数は POSIX において最近作られたものである。
128 System V (別名 UNIX 98) 疑似端末をサポートする UNIX 実装の中には、
129 この関数を持たないものもあるが、以下のようにして簡単に実装できる:
130 .in +4n
131 .nf
132
133 int
134 posix_openpt(int flags)
135 {
136     return open("/dev/ptmx", flags);
137 }
138 .fi
139 .in
140 .\"O .SH "SEE ALSO"
141 .SH 関連項目
142 .BR open (2),
143 .BR getpt (3),
144 .BR grantpt (3),
145 .BR ptsname (3),
146 .BR unlockpt (3),
147 .BR pts (4),
148 .BR pty (7)