⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ttyname_r.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>ttyname</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_010_175">&nbsp;</a>NAME</h4><blockquote>ttyname, ttyname_r - find pathname of a terminal</blockquote><h4><a name = "tag_000_010_176">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;char *ttyname(int <i>fildes</i>);int ttyname_r(int <i>fildes</i>, char *<i>name</i>, size_t <i>namesize</i>);</code></pre></blockquote><h4><a name = "tag_000_010_177">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i>ttyname()</i>function returns a pointer to a string containing anull-terminated pathnameof the terminal associated with file descriptor<i>fildes</i>.The return value may point to static data whose content isoverwritten by each call.<p>The<i>ttyname()</i>interface need not be reentrant.<p>The<i>ttyname_r()</i>function stores the null-terminated pathname of theterminal associated with the file descriptor<i>fildes</i>in the character array referenced by<i>name</i>.The array is<i>namesize</i>characters longand should have space for the name and the terminating null character.The maximum length of the terminal name is {TTY_NAME_MAX}.</blockquote><h4><a name = "tag_000_010_178">&nbsp;</a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>ttyname()</i>returns a pointer to a string.  Otherwise, a null pointer is returnedand<i>errno</i>is set to indicate the error.<p>If successful, the<i>ttyname_r()</i>function returns zero.Otherwise, an error number is returned to indicate the error.</blockquote><h4><a name = "tag_000_010_179">&nbsp;</a>ERRORS</h4><blockquote>The<i>ttyname()</i>function may fail if:<dl compact><dt>[EBADF]<dd>The<i>fildes</i>argument is not a valid file descriptor.<dt>[ENOTTY]<dd>The<i>fildes</i>argument does not refer to a terminal device.</dl><p>The <i>ttyname_r()</i>function may fail if:<dl compact><dt>[EBADF]<dd>The<i>fildes</i>argument is not a valid file descriptor.<dt>[ENOTTY]<dd>The<i>fildes</i>argument does not refer to a tty.<dt>[ERANGE]<dd>The value of<i>namesize</i>is smaller than the length of the stringto be returned including the terminating null character.</dl></blockquote><h4><a name = "tag_000_010_180">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_181">&nbsp;</a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_182">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_183">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.</blockquote><h4>DERIVATION</h4><blockquote><i>ttyname()</i> derived from Issue 1 of the SVID.<P><i>ttyname_r()</i> derived from the POSIX Threads Extension (1003.1c-1995).</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -