io_socketpair(3)
π io_socketpair β create a pair of sockets π
okay bestie, so this is io_socketpair from the <libowfat/io.h> era of your life (page 3 of the Library Functions Manual, she's fancy) and she is here to hand you two sockets that are already besties with each other. no cap.
β¨ SYNTAX β¨
#include <libowfat/io.h>
int io_socketpair(int64 pfd[2]);
πΈ DESCRIPTION πΈ
okay so here's the tea: io_socketpair creates a brand new UNIX socket pair and writes both descriptors to d. that's it, that's the job. π
and the way this socket pair works?? it's giving pipe energy, but make it bidirectional β meaning both descriptors are for reading and writing. so they can talk back and forth, mutual, no one-sided situationships here. it's giving healthy communication for once ππ«Ά
now for the important part, the vibe check on return values:
io_socketpairreturns1to indicate success β¨ iconic, ate, no notes.- if something goes wrong, it returns
0and setserrnoto indicate the error π in that case it frees any memory that it allocated for the new socketpair, and it leavesdalone. like, it cleans up after itself and does NOT touch your stuff. respectful king behavior honestly.
lowkey crucial:0means failure anderrnohas the lore. don't be out here ignoring that, bestie.
π SEE ALSO π
the girlies you should also be reading:
k that's the whole page, you're literally a socket pair expert now π stay hydrated, close your file descriptors, and remember β this was io_socketpair(3) from the Library Functions Manual, mwah ππβ¨π¦
π¦ 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