---
name: "socket_getifname"
section: "3diet"
platform: "linux"
package: "libowfat-dev"
version: "0.28-2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/socket_getifname/3diet"
---

# socket\_getifname(3diet)

get interface name

## NAME

socket\_getifname - get interface name

## SYNTAX

**#include \<socket.h\>**

const char\* **socket\_getifname**(uint32 *interface*);

## DESCRIPTION

socket\_getifname returns the symbolic interface name for a network interface number.  The returned char\* is a static buffer in the libc. If you query the named for more than one interface, you have to save the name before calling **socket\_getifidx** again.

If something goes wrong, socket\_getifname returns "\[unknown\]".

## SEE ALSO

[socket\_getifidx(3)](/socket_getifidx/3.md), [socket\_connect6(3)](/socket_connect6/3.md)
