.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright (C) 2004 Michael Kerrisk .\" .\" 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. .\" .\" Japanese Version Copyright (c) 2005 Yuichi SATO .\" all rights reserved. .\" Translated Sun Jan 30 08:55:16 JST 2005 .\" by Yuichi SATO .\" .TH POSIX_OPENPT 3 2010-10-04 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O posix_openpt \- open a pseudoterminal device posix_openpt \- 疑似端末 (pseudoterminal) デバイスをオープンする .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .B #include .sp .BI "int posix_openpt(int " flags ");" .fi .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .BR posix_openpt (): _XOPEN_SOURCE\ >=\ 600 .ad b .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR posix_openpt () .\"O function opens an unused pseudoterminal master device, returning a .\"O file descriptor that can be used to refer to that device. .BR posix_openpt () 関数は使用されていない疑似端末マスタデバイスをオープンし、 そのデバイスを参照するために使うファイルディスクリプタを返す。 .\"O The .\"O .I flags .\"O argument is a bit mask that ORs together zero or more of .\"O the following flags: .I flags 引き数は、以下のフラグのうち 0 個以上の OR をとったビットマスクである。 .TP .B O_RDWR .\"O Open the device for both reading and writing. .\"O It is usual to specify this flag. 読み書きのためにデバイスをオープンする。 普通はこのフラグを指定する。 .TP .B O_NOCTTY .\"O Do not make this device the controlling terminal for the process. このデバイスをプロセスの制御端末としない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, .\"O .BR posix_openpt () .\"O returns a nonnegative file descriptor which is the lowest .\"O numbered unused descriptor. 成功した場合、 .BR posix_openpt () は負ではないファイルディスクリプタを返す。 これは使用されていないディスクリプタのうち最小の値である。 .\"O On failure, \-1 is returned, and .\"O .I errno .\"O is set to indicate the error. 失敗した場合、\-1 が返されて、エラーを示すために .I errno が設定される。 .\"O .SH ERRORS .SH エラー .\"O See .\"O .BR open (2). .BR open (2) を参照すること。 .\"O .SH VERSIONS .SH バージョン .\"O Glibc support for .\"O .BR posix_openpt () .\"O has been provided since version 2.2.1. .BR posix_openpt () の glibc でのサポートはバージョン 2.2.1 以降で提供されている。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR posix_openpt () .\"O is part of the UNIX 98 pseudoterminal support (see .\"O .BR pts (4)). .\"O This function is specified in POSIX.1-2001. .BR posix_openpt () は UNIX 98 疑似端末サポート .RB ( pts (4) を参照) の一部である。 この関数は POSIX.1-2001 で指定されている。 .\"O .SH NOTES .SH 注意 .\"O This function is a recent invention in POSIX. .\"O Some UNIX implementations that support System V .\"O (aka UNIX 98) pseudoterminals don't have this function, but it .\"O is easy to implement: この関数は POSIX において最近作られたものである。 System V (別名 UNIX 98) 疑似端末をサポートする UNIX 実装の中には、 この関数を持たないものもあるが、以下のようにして簡単に実装できる: .in +4n .nf int posix_openpt(int flags) { return open("/dev/ptmx", flags); } .fi .in .\"O .SH "SEE ALSO" .SH 関連項目 .BR open (2), .BR getpt (3), .BR grantpt (3), .BR ptsname (3), .BR unlockpt (3), .BR pts (4), .BR pty (7)