.\" %%%LICENSE_START(PUBLIC_DOMAIN) .\" This page is in the public domain. - aeb .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI .\" all rights reserved. .\" Translated Tue Jul 8 01:56:27 JST 2003 .\" by Akihiro MOTOKI .\" .TH GRANTPT 3 2017\-09\-15 GNU "Linux Programmer's Manual" .SH 名前 grantpt \- スレーブ擬似端末へのアクセスを許可する .SH 書式 \fB#include \fP .PP \fBint grantpt(int \fP\fIfd\fP\fB);\fP .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP .ad l \fBgrantpt\fP(): .br .RS 4 glibc 2.24 以降: _XOPEN_SOURCE\ >=\ 500 || (_XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED) .br glibc 2.23 以前: _XOPEN_SOURCE .RE .ad .SH 説明 \fBgrantpt\fP() 関数は、ファイルディスクリプター \fIfd\fP で参照されたマスタ擬似端末に対応するスレーブ擬似端末デバイス のモードと所有者を変更する。 スレーブのユーザーID は呼び出したプロセスの実 UID に設定される。 グループID として設定される値は規定されていない (例えば \fItty\fP になる)。 スレーブのモードは 0620 (crw\-\-w\-\-\-\-) に設定される。 .PP \fBSIGCHLD\fP シグナルを捕捉するためにシグナルハンドラーが設定されている場合の \fBgrantpt\fP() の動作は規定されていない。 .SH 返り値 成功した場合、 \fBgrantpt\fP() は 0 を返す。そうでない場合、\-1 を返し、 \fIerrno\fP に適切な値がセットされる。 .SH エラー .TP \fBEACCES\fP 対応するスレーブ擬似端末にアクセスできなかった。 .TP \fBEBADF\fP 引数 \fIfd\fP が有効なオープンされたファイルディスクリプターでない。 .TP \fBEINVAL\fP 引数 \fIfd\fP は有効だが、マスタ擬似端末に対応するものではない。 .SH バージョン \fBgrantpt\fP() は、バージョン 2.1 以降の glibc で提供されている。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBgrantpt\fP() T} Thread safety MT\-Safe locale .TE .sp 1 .SH 準拠 POSIX.1\-2001, POSIX.1\-2008. .SH 注意 これは UNIX 98 疑似端末仕様の一部である。 \fBpts\fP(4) を参照。 .PP Many systems implement this function via a set\-user\-ID helper binary called "pt_chown". On Linux systems with a devpts filesystem (present since Linux 2.2), the kernel normally sets the correct ownership and permissions for the pseudoterminal slave when the master is opened (\fBposix_openpt\fP(3)), so that nothing must be done by \fBgrantpt\fP(). Thus, no such helper binary is required (and indeed it is configured to be absent during the glibc build that is typical on many systems). .SH 関連項目 \fBopen\fP(2), \fBposix_openpt\fP(3), \fBptsname\fP(3), \fBunlockpt\fP(3), \fBpts\fP(4), \fBpty\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。