1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This man page was written by Jeremy Phelps <jphelps@notreached.net>.
3 .\" Redistribute and modify at will.
5 .\"*******************************************************************
7 .\" This file was generated with po4a. Translate the source file.
9 .\"*******************************************************************
10 .TH GETPT 3 2010\-09\-10 GNU "Linux Programmer's Manual"
12 getpt \- 擬似端末マスタ (PTM) をオープンする
15 \fB#define _GNU_SOURCE\fP /* feature_test_macros(7) 参照 */
16 \fB#include <stdlib.h>\fP
18 \fBint getpt(void);\fP
21 \fBgetpt\fP() は、擬似端末マスタをオープンし、そのファイル・ディスクリプタを返す。 これは、 Linux システムにおいては
24 open(/dev/ptmx, O_RDWR | O_NOCTTY);
27 と等価である。但し、 GNU Libc を使用していても、 擬似端末マスタがどこか他の場所にあるシステムもある。
29 成功した場合、 \fBgetpt\fP() はオープンしたファイルのディスクリプタを返す。 そうでない場合、\-1 を返し、 \fIerrno\fP
32 \fBgetpt\fP() は \fBopen\fP(2) で説明されている種々のエラーで失敗する可能性がある。
34 \fBgetpt\fP() は、バージョン 2.1 以降の glibc で提供されている。
36 \fBgetpt\fP() は glibc 独自である。代わりに \fBposix_openpt\fP(3) を使用すること。
38 \fBgrantpt\fP(3), \fBposix_openpt\fP(3), \fBptsname\fP(3), \fBunlockpt\fP(3),
39 \fBptmx\fP(4), \fBpty\fP(7)