kernel_sendmsg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’Œ 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 here
  • num β€” vec array length. how many entries in vec you're working with
  • size β€” 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:


πŸ’« 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