kernel_accept(9)
π NAME π
kernel_accept β accept a connection (kernel space) β¨
okay so bestie, this is kernel_accept(9) from the Kernel API Manual, and it's literally the kernel-space way to accept a connection. no cap. π«Ά
πΈ SYNOPSIS πΈ
int kernel_accept (struct socket *sock , struct socket **newsock , int
flags );
π ARGUMENTS π
sockβ the listening socket, aka the one out here waiting for a connection to slide into its DMs πnewsockβ the new connected socket, aka the fresh little connection that shows up after accept slays β¨flagsβ the flags. yes, that's the whole description. iconic brevity, honestly π
π¦ DESCRIPTION π¦
okay so here's the vibe check: flags must be SOCK_CLOEXEC, SOCK_NONBLOCK, or 0. those are the only choices, bestie β no improvising, no "oops I made up a flag" energy π
if it fails, newsock is guaranteed to be NULL. like, that's the promise. no dangling fake socket, periodt. π₯
it returns 0 or an error. that's it. that's the whole return situation π
π SEE ALSO π
Kernel file ./net/socket.c β and the whole extended friend group, iykyk:
move_addr_to_kernel(9)move_addr_to_user(9)sock_read_xattr(9)sock_alloc_file(9)sock_from_file(9)sockfd_lookup(9)sock_alloc(9)sock_release(9)sock_sendmsg(9)kernel_sendmsg(9)sock_recvmsg(9)kernel_recvmsg(9)sock_create_lite(9)__sock_create(9)sock_create(9)sock_create_kern(9)sock_register(9)sock_unregister(9)kernel_bind(9)kernel_listen(9)kernel_connect(9)kernel_getsockname(9)kernel_getpeername(9)kernel_sock_shutdown(9)kernel_sock_ip_overhead(9)
okay bye bestie π«Ά β source/version is ./net and the date is October 2026, so that's the cute lil sign-off β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms