af_alg_sendmsg(9)
π 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 frivsizeβ 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 π
< 0upon 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 π
- Kernel file
./crypto/af_alg.c af_alg_alloc_tsgl(9)af_alg_count_tsgl(9)af_alg_pull_tsgl(9)af_alg_free_areq_sgls(9)af_alg_wait_for_wmem(9)af_alg_wmem_wakeup(9)af_alg_wait_for_data(9)af_alg_data_wakeup(9)af_alg_free_resources(9)af_alg_poll(9)af_alg_alloc_areq(9)af_alg_get_rsgl(9)
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
- 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