kernel_connect(9)
π« kernel_connect(9) π«
okay bestie, so this is a page from the Kernel API Manual and it's literally called kernel_connect β yes, the connect-a-socket situation but make it kernel space π
β¨ NAME β¨
kernel_connect β connect a socket (kernel space) π«Ά
πΈ SYNOPSIS πΈ
int kernel_connect (struct socket *sock , struct sockaddr_unsized *addr
, int addrlen , int flags );
no cap, that's the whole signature π
π¦ ARGUMENTS π¦
sockβ the socket itself, your main character π«Άaddrβ the addressaddrlenβ how long that address isflagsβ flags (O_NONBLOCK, ...) β and yes the...is doing a lot of work there, iykyk
π₯ DESCRIPTION π₯
so here's the tea β β what kernel_connect actually does depends on what kind of socket you're dealing with, and ngl it's giving two very different vibes:
- For datagram sockets π β
addris the address to which datagrams are sent by default, and it's the only address from which datagrams are received. periodt, that's the one - For stream sockets π β it attempts to connect to
addr.
and it returns 0 or an error code. that's it, that's the whole energy β¨
π SEE ALSO π
Kernel file ./net/socket.c β and the whole friend group:
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_accept(9)kernel_getsockname(9)kernel_getpeername(9)kernel_sock_shutdown(9)kernel_sock_ip_overhead(9)
literally the entire socket cinematic universe πβ
that's the whole page bestie, go connect some sockets in kernel space, slay ππ
source: ./net β dated October 2026 β page: kernel_connect(9) β¨ bye ily π«Ά
π¦ 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