📄 if_indextoname.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-2004 IEEE and The Open Group, All Rights Reserved --><title>if_indextoname</title></head><body bgcolor="white"><basefont size="3"> <a name="if_indextoname"></a> <a name="tag_03_271"></a><!-- if_indextoname --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2004 Edition<br>Copyright © 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_271_01"></a>NAME</h4><blockquote>if_indextoname - map a network interface index to its corresponding name</blockquote><h4><a name="tag_03_271_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>#include <<a href="../basedefs/net/if.h.html">net/if.h</a>><br><br> char *if_indextoname(unsigned</tt> <i>ifindex</i><tt>, char *</tt><i>ifname</i><tt>);<br></tt></code></p></blockquote><h4><a name="tag_03_271_03"></a>DESCRIPTION</h4><blockquote><p>The <i>if_indextoname</i>() function shall map an interface index to its corresponding name.</p><p>When this function is called, <i>ifname</i> shall point to a buffer of at least {IF_NAMESIZE} bytes. The function shall place inthis buffer the name of the interface with index <i>ifindex</i>.</p></blockquote><h4><a name="tag_03_271_04"></a>RETURN VALUE</h4><blockquote><p>If <i>ifindex</i> is an interface index, then the function shall return the value supplied in <i>ifname</i>, which points to abuffer now containing the interface name. Otherwise, the function shall return a NULL pointer and set <i>errno</i> to indicate theerror.</p></blockquote><h4><a name="tag_03_271_05"></a>ERRORS</h4><blockquote><p>The <i>if_indextoname</i>() function shall fail if:</p><dl compact><dt>[ENXIO]</dt><dd>The interface does not exist.</dd></dl></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_271_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_271_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_271_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_271_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_271_10"></a>SEE ALSO</h4><blockquote><p><a href="getsockopt.html"><i>getsockopt</i>()</a>, <a href="if_freenameindex.html"><i>if_freenameindex</i>()</a>, <a href="if_nameindex.html"><i>if_nameindex</i>()</a>, <a href="if_nametoindex.html"><i>if_nametoindex</i>()</a>, <a href="setsockopt.html"><i>setsockopt</i>()</a>, the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/net/if.h.html"><i><net/if.h></i></a></p></blockquote><h4><a name="tag_03_271_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 6. Derived from the XNS, Issue 5.2 specification.</p><p>IEEE Std 1003.1-2001/Cor 1-2002, item XSH/TC1/D6/28 is applied, changing {IFNAMSIZ} to {IF_NAMESIZ} in theDESCRIPTION.</p></blockquote><div class="box"><em>End of informative text.</em></div><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 + -