socket_local6(3)
π socket_local6(3) π
okay so bestie, this one lives in the Library Functions Manual and it's literally called socket_local6 β say hi π
β¨ NAME β¨
socket_local6 β get local IP address of socket π«Ά
πΈ SYNTAX πΈ
#include <libowfat/socket.h>
int socket_local6(int s,char ip[16],uint16 *port,uint32 *scope_id);
π¦ DESCRIPTION π¦
so like, socket_local6 returns the local IPv6 address, port and scope ID for the UDP or TCP socket s, and writes stuff out like the main character it is π
:
- the IPv6 address goes to
ip - the port goes to
port - the scope ID goes to
scope_id
and if scope_id is the null pointer? no stress, it just discards the scope ID entirely, like it never happened π
but bestie, if something goes wrong,socket_local6returns-1and setserrnoappropriately. so check it, fr fr. π
π SEE ALSO π
k bye ily, this was socket_local6(3) from the Library Functions Manual β that's the source and the whole vibe, go forth and slay β¨ππ
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms