.\" Copyright (C) 2004 Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2005 Yuichi SATO .\" all rights reserved. .\" Translated Sun Jan 30 08:55:16 JST 2005 .\" by Yuichi SATO .\" Updated 2012-05-01, Akihiro MOTOKI .\" .TH POSIX_OPENPT 3 2014\-06\-03 "" "Linux Programmer's Manual" .SH 名前 posix_openpt \- 疑似端末 (pseudoterminal) デバイスをオープンする .SH 書式 .nf \fB#include \fP \fB#include \fP .sp \fBint posix_openpt(int \fP\fIflags\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp .ad l \fBposix_openpt\fP(): _XOPEN_SOURCE\ >=\ 600 .ad b .SH 説明 \fBposix_openpt\fP() 関数は使用されていない疑似端末マスタデバイスをオープンし、 そのデバイスを参照するために使うファイルディスクリプターを返す。 \fIflags\fP 引き数は、以下のフラグのうち 0 個以上の OR をとったビットマスクである。 .TP \fBO_RDWR\fP 読み書きのためにデバイスをオープンする。 普通はこのフラグを指定する。 .TP \fBO_NOCTTY\fP このデバイスをプロセスの制御端末としない。 .SH 返り値 成功した場合、 \fBposix_openpt\fP() は負ではないファイルディスクリプターを返す。 これは使用されていないディスクリプターのうち最小の値である。 失敗した場合、\-1 が返されて、エラーを示すために \fIerrno\fP が設定される。 .SH エラー \fBopen\fP(2) を参照すること。 .SH バージョン \fBposix_openpt\fP() の glibc でのサポートはバージョン 2.2.1 以降で提供されている。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" \fBposix_openpt\fP() 関数はスレッドセーフである。 .SH 準拠 \fBposix_openpt\fP() は UNIX 98 疑似端末サポート (\fBpts\fP(4) を参照) の一部である。 この関数は POSIX.1\-2001 で指定されている。 .SH 注意 \fBposix_openpt\fP() 関数は POSIX において最近作られたものである。 System V (別名 UNIX 98) 疑似端末をサポートする UNIX 実装の中には、 この関数を持たないものもあるが、以下のようにして簡単に実装できる: .in +4n .nf int posix_openpt(int flags) { return open("/dev/ptmx", flags); } .fi .in .PP \fBposix_openpt\fP() を呼び出すと、対応する擬似端末スレーブデバイスのパス 名が生成される。スレーブデバイスのパス名は \fBptsname\fP(3) を使って取得 できる。スレーブデバイスのパス名はマスターデバイスがオープンされている 間だけ存在する。 .SH 関連項目 \fBopen\fP(2), \fBgetpt\fP(3), \fBgrantpt\fP(3), \fBptsname\fP(3), \fBunlockpt\fP(3), \fBpts\fP(4), \fBpty\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。