if_indextoname - map an interface index to its corresponding name
#include <net/if.h> char *if_indextoname(unsigned int ifindex, char *ifname);
When this function is called, ifname must point to a buffer of at least IFNAMSIZ bytes. The function places in this buffer the name of the interface with index ifindex.
If ifindex is an interface index then the function returns the value supplied in ifname, which points to a buffer now containing the interface name. Otherwise the function returns a NULL pointer.
- [EFAULT]
- The buffer pointed to by ifname can not be accessed or written.
getsockopt() ,if_freenameindex() ,if_nameindex() ,if_nametoindex() ,setsockopt() ,<net/if.h> .
First released in Issue 5.2.
Contents | Next section | Index |