📄 grantpt.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>grantpt</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="grantpt"></a> <a name="tag_03_262"></a><!-- grantpt --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_262_01"></a>NAME</h4><blockquote>grantpt - grant access to the slave pseudo-terminal device</blockquote><h4><a name="tag_03_262_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include <<a href="../basedefs/stdlib.h.html">stdlib.h</a>><br><br> int grantpt(int</tt> <i>fildes</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_03_262_03"></a>DESCRIPTION</h4><blockquote><p>The <i>grantpt</i>() function shall change the mode and ownership of the slave pseudo-terminal device associated with its masterpseudo-terminal counterpart. The <i>fildes</i> argument is a file descriptor that refers to a master pseudo-terminal device. Theuser ID of the slave shall be set to the real UID of the calling process and the group ID shall be set to an unspecified group ID.The permission mode of the slave pseudo-terminal shall be set to readable and writable by the owner, and writable by the group.</p><p>The behavior of the <i>grantpt</i>() function is unspecified if the application has installed a signal handler to catch SIGCHLDsignals.</p></blockquote><h4><a name="tag_03_262_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, <i>grantpt</i>() shall return 0; otherwise, it shall return -1 and set <i>errno</i> to indicate theerror.</p></blockquote><h4><a name="tag_03_262_05"></a>ERRORS</h4><blockquote><p>The <i>grantpt</i>() function may fail if:</p><dl compact><dt>[EBADF]</dt><dd>The <i>fildes</i> argument is not a valid open file descriptor.</dd><dt>[EINVAL]</dt><dd>The <i>fildes</i> argument is not associated with a master pseudo-terminal device.</dd><dt>[EACCES]</dt><dd>The corresponding slave pseudo-terminal device could not be accessed.</dd></dl></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_262_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_262_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_262_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_262_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_262_10"></a>SEE ALSO</h4><blockquote><p><a href="open.html"><i>open</i>()</a> , <a href="ptsname.html"><i>ptsname</i>()</a> , <a href="unlockpt.html"><i>unlockpt</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/stdlib.h.html"><i><stdlib.h></i></a></p></blockquote><h4><a name="tag_03_262_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4, Version 2.</p></blockquote><h4><a name="tag_03_262_12"></a>Issue 5</h4><blockquote><p>Moved from X/OPEN UNIX extension to BASE.</p><p>The last paragraph of the DESCRIPTION is moved from the APPLICATION USAGE section.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -