Map an interface index to its name
#include <net/if.h>
char * if_indextoname( unsigned int ifindex,
char * ifname );
The if_indextoname() function maps the interface index specified by ifindex to its corresponding name. The name is copied into the buffer pointed to by ifname.
A pointer to the name, or NULL if There isn't an interface corresponding to the specified index.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |