sock_create_kern(9)
π sock_create_kern(9) π
okay so bestie, welcome to the Kernel API Manual β yes we're in kernel land today, and yes this one is lowkey iconic. it's giving "let me just make a socket real quick, but make it kernel space" β¨
π NAME π
sock_create_kern β creates a socket (kernel space) π«Ά
πΈ SYNOPSIS πΈ
int sock_create_kern (struct net *net , int family , int type , int
protocol , struct socket **res );
like, that's the whole vibe. copy it exactly pls, no autocorrect π
β¨ ARGUMENTS β¨
netβ the net namespace, bestie. that's your little networking bubble πfamilyβ the protocol family (AF_INET, ...) β pick your fighter πtypeβ the communication type (SOCK_STREAM, ...) β the how of it all πprotocolβ the protocol (0, ...) β yes, zero is a real answer, it's valid, don't come for it πresβ your brand new socket goes here, main character delivery spot π
π¦ DESCRIPTION π¦
so what does it actually do? it's a wrapper around __sock_create, periodt. π
it returns 0 or an error β that's it, that's the whole return contract, no cap.
and the little detail you literally cannot skip: this function internally uses GFP_KERNEL. that's not a vibe, that's a fact, write it down ποΈ
π SEE ALSO π
okay this list is long, but we do not skip, we do not summarise, we list every single one because that's the rules π
first up, the kernel file: ./net/socket.c, then:
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_register(9)sock_unregister(9)kernel_bind(9)kernel_listen(9)kernel_accept(9)kernel_connect(9)kernel_getsockname(9)kernel_getpeername(9)kernel_sock_shutdown(9)kernel_sock_ip_overhead(9)
go read them, i'll wait π§
fr fr, that's the whole page. no secret extra options hiding in here β what you see is what you get π
and that's a wrap, bestie!! this one came from ./net, dated October 2026, and it's filed under sock_create_kern(9) β slay, go make some kernel sockets responsibly π
β¨π
π¦ 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