.\" Hey Emacs! This file is -*- nroff -*- source. .\" This page is in the public domain. - aeb .\" .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI .\" all rights reserved. .\" Translated Tue Jul 8 01:56:27 JST 2003 .\" by Akihiro MOTOKI .\" .\"WORD: pseudoterminal 擬似端末 .\"WORD: pseudotty 擬似端末 .\" .TH GRANTPT 3 2008-06-14 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .\"O grantpt \- grant access to the slave pseudoterminal .SH 名前 grantpt \- スレーブ擬似端末へのアクセスを許可する .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) 参照 */" .br .B #include .sp .BI "int grantpt(int " fd ");" .fi .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR grantpt () .\"O function changes the mode and owner of the slave pseudoterminal device .\"O corresponding to the master pseudoterminal referred to by .\"O .IR fd . .BR grantpt () 関数は、 .I fd で参照されたマスタ擬似端末に対応するスレーブ擬似端末デバイス のモードと所有者を変更する。 .\"O The user ID of the slave is set to the real UID of the calling process. .\"O The group ID is set to an unspecified value (e.g., \fItty\fP). .\"O The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-). スレーブのユーザID は呼び出したプロセスの実 UID に設定される。 グループID として設定される値は規定されていない (例えば \fItty\fP になる)。 スレーブのモードは 0620 (crw\-\-w\-\-\-\-) に設定される。 .PP .\"O The behavior of .\"O .BR grantpt () .\"O is unspecified if a signal handler is installed to catch .\"O .B SIGCHLD .\"O signals. .B SIGCHLD シグナルを捕捉するためにシグナル・ハンドラが設定されている場合の .BR grantpt () の動作は規定されていない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O When successful, .\"O .BR grantpt () .\"O returns 0. .\"O Otherwise, it returns \-1 and sets .\"O .I errno .\"O appropriately. 成功した場合、 .BR grantpt () は 0 を返す。そうでない場合、\-1 を返し、 .I errno に適切な値がセットされる。 .\"O .SH ERRORS .SH エラー .TP .B EACCES .\"O The corresponding slave pseudoterminal could not be accessed. 対応するスレーブ擬似端末にアクセスできなかった。 .TP .B EBADF .\"O The .\"O .I fd .\"O argument is not a valid open file descriptor. 引き数 .I fd が有効なオープンされたファイル・ディスクリプタでない。 .TP .B EINVAL .\"O The .\"O .I fd .\"O argument is valid but not associated with a master pseudoterminal. 引き数 .I fd は有効だが、マスタ擬似端末に対応するものではない。 .\"O .SH VERSIONS .SH バージョン .\"O .BR grantpt () .\"O is provided in glibc since version 2.1. .BR grantpt () は、バージョン 2.1 以降の glibc で提供されている。 .\"O .SH "CONFORMING TO" .SH 準拠 POSIX.1-2001. .\"O .SH NOTES .SH 備考 .\"O This is part of the UNIX 98 pseudoterminal support, see .\"O .BR pts (4). .\"O Many systems implement this function via a set-user-ID helper binary .\"O called "pt_chown". .\"O With Linux devpts no such helper binary is required. これは UNIX 98 擬似端末 (pseudoterminal) 仕様の一部である。 .BR pts (4) を参照のこと。 多くのシステムでは、この関数は "pt_chown" と呼ばれる set-user-ID された 補助バイナリを用いて実装されている。 Linux の devpts では、このような補助バイナリを必要としない。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR open (2), .BR posix_openpt (3), .BR ptsname (3), .BR unlockpt (3), .BR pts (4), .BR pty (7)