1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" This page is in the public domain. - aeb
4 .\" Japanese Version Copyright (c) 2003 Akihiro MOTOKI
5 .\" all rights reserved.
6 .\" Translated Tue Jul 8 01:56:27 JST 2003
7 .\" by Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
9 .\"WORD: pseudoterminal µ¼»÷üËö
10 .\"WORD: pseudotty µ¼»÷üËö
12 .TH GRANTPT 3 2008-06-14 "GNU" "Linux Programmer's Manual"
14 .\"O grantpt \- grant access to the slave pseudoterminal
16 grantpt \- ¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ø¤Î¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë
20 .\"O .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
21 .BR "#define _XOPEN_SOURCE" " /* feature_test_macros(7) »²¾È */"
23 .B #include <stdlib.h>
25 .BI "int grantpt(int " fd ");"
31 .\"O function changes the mode and owner of the slave pseudoterminal device
32 .\"O corresponding to the master pseudoterminal referred to by
37 ¤Ç»²¾È¤µ¤ì¤¿¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¥Ç¥Ð¥¤¥¹
38 ¤Î¥â¡¼¥É¤È½êͼԤòÊѹ¹¤¹¤ë¡£
39 .\"O The user ID of the slave is set to the real UID of the calling process.
40 .\"O The group ID is set to an unspecified value (e.g., \fItty\fP).
41 .\"O The mode of the slave is set to 0620 (crw\-\-w\-\-\-\-).
42 ¥¹¥ì¡¼¥Ö¤Î¥æ¡¼¥¶ID ¤Ï¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Î¼Â UID ¤ËÀßÄꤵ¤ì¤ë¡£
43 ¥°¥ë¡¼¥×ID ¤È¤·¤ÆÀßÄꤵ¤ì¤ëÃͤϵ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤ (Î㤨¤Ð \fItty\fP ¤Ë¤Ê¤ë)¡£
44 ¥¹¥ì¡¼¥Ö¤Î¥â¡¼¥É¤Ï 0620 (crw\-\-w\-\-\-\-) ¤ËÀßÄꤵ¤ì¤ë¡£
48 .\"O is unspecified if a signal handler is installed to catch
52 ¥·¥°¥Ê¥ë¤òÊ᪤¹¤ë¤¿¤á¤Ë¥·¥°¥Ê¥ë¡¦¥Ï¥ó¥É¥é¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î
54 ¤ÎÆ°ºî¤Ïµ¬Äꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
55 .\"O .SH "RETURN VALUE"
60 .\"O Otherwise, it returns \-1 and sets
65 ¤Ï 0 ¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
67 ¤ËŬÀÚ¤ÊÃͤ¬¥»¥Ã¥È¤µ¤ì¤ë¡£
72 .\"O The corresponding slave pseudoterminal could not be accessed.
73 Âбþ¤¹¤ë¥¹¥ì¡¼¥Öµ¼»÷üËö¤Ë¥¢¥¯¥»¥¹¤Ç¤¤Ê¤«¤Ã¤¿¡£
78 .\"O argument is not a valid open file descriptor.
81 ¤¬Í¸ú¤Ê¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
86 .\"O argument is valid but not associated with a master pseudoterminal.
89 ¤Ï͸ú¤À¤¬¡¢¥Þ¥¹¥¿µ¼»÷üËö¤ËÂбþ¤¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£
93 .\"O is provided in glibc since version 2.1.
95 ¤Ï¡¢¥Ð¡¼¥¸¥ç¥ó 2.1 °Ê¹ß¤Î glibc ¤ÇÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
96 .\"O .SH "CONFORMING TO"
101 .\"O This is part of the UNIX 98 pseudoterminal support, see
103 .\"O Many systems implement this function via a set-user-ID helper binary
104 .\"O called "pt_chown".
105 .\"O With Linux devpts no such helper binary is required.
106 ¤³¤ì¤Ï UNIX 98 µ¼»÷üËö (pseudoterminal) »ÅÍͤΰìÉô¤Ç¤¢¤ë¡£
109 ¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï "pt_chown" ¤È¸Æ¤Ð¤ì¤ë set-user-ID ¤µ¤ì¤¿
110 Êä½õ¥Ð¥¤¥Ê¥ê¤òÍѤ¤¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
111 Linux ¤Î devpts ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤ÊÊä½õ¥Ð¥¤¥Ê¥ê¤òɬÍפȤ·¤Ê¤¤¡£
115 .BR posix_openpt (3),