SOCKET_ACCEPT4_MAKENONBLOCKING_SETCLOSEONEXEC(3)
okay so bestie, welcome to the socket_acc...closeonexec(3) page from the Library Functions Manual β yes, the title is literally abbreviated like that π β and the main-character function is socket_accept4_makenonblocking_setcloseonexec. Say it three times fast, I dare you π
π NAME π
socket_accept4_makenonblocking_setcloseonexecβ accept an IPv4 TCP connection on a socket and set it to non-blocking I/O and close-on-exec.
β¨ SYNOPSIS β¨
#include <libowfat/socket.h>
int socket_accept4_makenonblocking_setcloseonexec(int s,char
ip[4],uint16 *port);
π DESCRIPTION π
This one is functionally equivalent to calling socket_accept4 and then calling ndelay_on and io_tcloseonexec on the returned socket. Thatβs the whole vibe, fr fr.
The page literally says: βHowever, if may save a syscall or two and in the process avoid a race condition.β Yes, βif mayβ is right there in the original β we are not gaslighting you π. The meaning is that it may save a syscall or two and in the process avoid a race condition. Iconic efficiency, no cap β¨
πΈ EXAMPLE πΈ
#include <libowfat/socket.h>
int s;
char ip[4];
uint16 p;
s = socket_tcp4();
socket_bind4(s,ip,p);
socket_listen(s,16);
socket_accept4_makenonblocking_setcloseonexec(s,ip,&p);
π¦ SEE ALSO π¦
Go be nosy, bestie:
socket_accept4(3)socket_connected(3)socket_accept4_makenonblocking(3)socket_accept4_setcloseonexec(3)socket_accept6_makenonblocking_setcloseonexec(3)
Cute sign-off π: the footerβs source/version/date situation is just the repeated socket_acc...closeonexec(3) β no actual date is printed here β so bye bestie, go accept some connections and slay ππ
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms