SOCKET_ACCEPT6_MAKENONBLOCKING_SETCLOSEONEXEC(3)
π NAME π
okay bestie, welcome to socket_acc...closeonexec(3) from the Library Functions Manual β yes, the title is a whole mouthful and it ate π
socket_accept6_makenonblocking_setcloseonexec β accept an IPv6 TCP connection on a socket and set it to non-blocking I/O and close-on-exec. iconic behavior, honestly π
#include <libowfat/socket.h>
int socket_accept6_makenonblocking_setcloseonexec(int s,char
ip[4],uint16 *port,uint16* scope_id);
πΈ DESCRIPTION πΈ
This is functionally equivalent to calling socket_accept6 and then calling ndelay_on and io_tcloseonexec on the returned socket. like, same energy, same result π
However, if may save a syscall or two and in the process avoid a race condition β yes, that's literally how the original words it, and the vibe is very "trust me bestie" ππ₯ no cap, fewer syscalls and no race condition is a slay.
β¨ EXAMPLE β¨
#include <libowfat/socket.h>
int s;
char ip[16];
uint16 p;
uint16 scope_id;
s = socket_tcp6();
socket_bind6(s,ip,p,scope_id);
socket_listen(s,16);
socket_accept6_makenonblocking_setcloseonexec(s,ip,&p,&scope_id);
copy it exactly, bestie β the ip[16] here and the ip[4] in the signature are both giving main character energy, so we keep them as written π«Άπ
π SEE ALSO π
socket_accept6(3)socket_connected(3)socket_accept6_makenonblocking(3)socket_accept6_setcloseonexec(3)socket_accept4_makenonblocking_setcloseonexec(3)
source/version/date sign-off: the footer only gives socket_acc...closeonexec(3) β no extra source, version, or date info shows up on this page, so that's the whole metadata moment π«Άβ¨
π¦ 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