kernel_sendmsg(9)
π kernel_sendmsg(9) β straight out of the Kernel API Manual, bestie
okay so picture this: you're deep in kernel space, you've got a socket, and you need to send a message through it. that's it. that's the whole vibe. this page is your group chat tutorial for it π
β¨ NAME β¨
kernel_sendmsg β send a message through @sock (kernel-space, no cap)
π¦ SYNOPSIS π¦
int kernel_sendmsg (struct socket *sock , struct msghdr *msg , struct
kvec *vec , size_t num , size_t size );
like, yes, the line breaks are a little chaotic, she's doing her best π«Ά
π ARGUMENTS π
sockβ the socket. your main character. the thing the message goes through πmsgβ the message header. the β¨metadata momentβ¨vecβ kernel vec. the actual chunks of message data live herenumβ vec array length. how many entries invecyou're working withsizeβ total message data size. the full byte count of the message, not a guess, the real number π
π DESCRIPTION π
so here's what goes down: it builds the message data with vec and sends it through sock. that's the whole plot, no twist ending.
it returns the number of bytes sent β or an error code π so like, check the return value, bestie, don't just assume it slayed.
π SEE ALSO π
the kernel file ./net/socket.c, plus this whole iconic 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)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_connect(9)kernel_getsockname(9)kernel_getpeername(9)kernel_sock_shutdown(9)kernel_sock_ip_overhead(9)
π« the sign-off π«
this lil masterpiece lives under ./net, dated October 2026, and she answers to kernel_sendmsg(9). mwah π go send a message fr fr π§ββοΈβ¨
π¦ 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