af_alg_sendmsg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… af_alg_sendmsg(9) β€” like, the whole kernel API manual vibe πŸŽ€

okay so bestie, welcome to af_alg_sendmsg β€” this is a page straight out of the Kernel API Manual, and it's literally the implementation of the sendmsg system call handler. no cap. sit down, grab a strawberry drink πŸ“, we're getting into it.


✨ SYNOPSIS ✨

int af_alg_sendmsg (struct socket *sock , struct msghdr *msg , size_t
size , unsigned int ivsize );

that's it. that's the whole signature. she's giving four-arguments-and-a-dream energy πŸ’…


🌸 ARGUMENTS 🌸

  • sock β€” the socket of the connection to user space. that's your girl, the link between here and there 🫢
  • msg β€” the message coming in from user space. the actual tea being passed β˜•
  • size β€” the size of that message from user space. gotta know how much tea, fr fr
  • ivsize β€” the size of the IV for the cipher operation, and it's there to verify that the user-space-provided IV has the right size. like a vibe check but for IVs πŸ‘‘ if the size is wrong, that's a problem, iykyk

πŸ¦‹ DESCRIPTION πŸ¦‹

so the sendmsg system call handler obtains the user data and stores it in ctx->tsgl_list. the way that it does this is β€” and this is the iconic part β€” it implies allocation of the required numbers of struct af_alg_tsgl. yes, allocation. on purpose. as a consequence. we love a data structure moment πŸ’–

and in addition?? the ctx gets filled with the information sent via CMSG. both things. at once. main character energy honestly ✨


⭐ RETURN ⭐

  • the number of copied data upon success πŸŽ‰
  • < 0 upon error πŸ’€

that's it, that's the return contract, no notes.

ngl bestie, if you get a negative number back, something went sideways β€” the manpage just says < 0 and leaves the drama to you πŸ™ˆ

🌈 SEE ALSO 🌈

that's the whole friend group right there β€” go say hi to all of them, they're all in ./crypto, they're all iconic πŸ§šβ€β™€οΈ


okay and that's the page!! mwah πŸ’‹ this little gem lives in ./crypto, it's the October 2026 edition of the Kernel API Manual, and it's signed off with the classic af_alg_sendmsg(9) energy. go read the source, bestie β€” periodt πŸ‘‘πŸ”₯

πŸ“¦ where this page comes from