af_alg_get_rsgl(9)
π af_alg_get_rsgl β bestie, let's build the RX SGL for the output data from the crypto operation
okay so this is the page for af_alg_get_rsgl(9) from the Kernel API Manual, and it is literally the function that creates the RX SGL for the output data from the crypto operation. that's the whole vibe. it's giving "scatterlist glow-up" and i'm obsessed π
β¨ SYNOPSIS β¨
int af_alg_get_rsgl (struct sock *sk , struct msghdr *msg , int flags ,
struct af_alg_async_req *areq , size_t maxsize , size_t *outlen );
no cap, that's the signature, copied exactly, don't come for me π«Ά
πΈ ARGUMENTS πΈ
okay so here's who's who at the function party β every single one of them:
skβ socket of connection to user space. that's the link to the userland side of things, the bridge bestie πmsgβ user space message. the actual message, living its life over in user space β¨flagsβ flags used to invokerecvmsgwith. yes, those flags. therecvmsgones. π₯areqβ instance of the cryptographic request that will hold the RX SGL. it's the main character that's gonna carry the SGL for us πmaxsizeβ maximum number of bytes to be pulled from user space. a hard cap, a limit, a boundary β respect it π§outlenβ number of bytes in the RX SGL. this is where the count gets reported back, iykyk π¦
β RETURN β
0on success π< 0upon error π (yes, less than zero β negative numbers mean something went wrong, fr fr)
π SEE ALSO π
Kernel file ./crypto/af_alg.c, plus the whole af_alg friend group β every single one, no gatekeeping:
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_sendmsg(9)af_alg_free_resources(9)af_alg_poll(9)af_alg_alloc_areq(9)
bestie reminder:0means slay, anything< 0means something went sideways. don't ignore a negative return, that's not cute π
and that's the page, periodt π β brought to you by the ./crypto corner of the kernel, dated October 2026, and filed under af_alg_get_rsgl(9) in the Kernel API Manual. mwah, go read the source, ily π«Άβ¨
π¦ 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