socket_broadcast(3)
β¨ socket_broadcast β the manual page β¨
okay so this one lives in the Library Functions Manual, bestie, and it's genuinely so simple you're gonna slay it π
πΈ NAME πΈ
socket_broadcast β flip a UDP socket into broadcast mode π£β¨
π SYNTAX π
#include <libowfat/socket.h>
int socket_broadcast(int s);
π DESCRIPTION π
so socket_broadcast sets the UDP socket s to broadcast mode. that's the whole vibe. π¦
and like, this part matters, okay? socket_send4 and socket_send6 will fail to send packets to the broadcast address unless you call socket_broadcast before. like, before before. no cap. π
normally socket_broadcast returns 0. iconic. flawless. no notes. β¨
but if anything goes wrong, it returns -1 and sets errno appropriately. so check your return values, babe, i'm begging π
π EXAMPLE π
#include <libowfat/socket.h>
int s;
if ((s=socket_udp6())==-1)
strerr_die2sys(111,FATAL,"unable to create UDP socket: ");
if (socket_broadcast(s) == -1)
strerr_die2sys(111,FATAL,"unable to set broadcast mode: ");
look at you go, setting up a socket and enabling broadcast and handling your errors like a whole main character ππ
π SEE ALSO π
and that's the page, bestie!! this lil cutie came from the Library Functions Manual, it's socket_broadcast(3), and yeah the footer is literally just socket_broadcast(3) again β no dramatic date, no version saga, just the section number doing its thing π go forth and broadcast π«Άπ
π¦ 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