sg_zero_buffer(9)
β¨ sg_zero_buffer(9) β¨
okay so bestie, welcome to the sg_zero_buffer page π
this one lives in the Kernel API Manual, and it's genuinely one of the cutest little helpers in the scatterlist world β it just zeroes out a chunk of your SG list. no drama, no cap π«Ά
πΈ SYNOPSIS πΈ
size_t sg_zero_buffer (struct scatterlist *sgl , unsigned int nents ,
size_t buflen , off_t skip );
like, look at that signature. she's gorgeous. returns a size_t, takes four things. let's get into it π
π ARGUMENTS π
sglβ the SG list itself, aka the scatterlist you're working on. this is your main character π«nentsβ the number of SG entries. how many of 'em we're dealing with π’buflenβ the number of bytes to zero out. literally the amount of zeroing we're doing β¨skipβ number of bytes to skip before the zeroing starts. so we don't zero from the very top, we vibe past the firstskipbytes first π
π¦ DESCRIPTION π¦
Returns the number of bytes zeroed. that's it, that's the whole function β she does the thing and tells you how much she did π iconic behaviour honestly. no extra lore, no secret side quests, just zeroes and a count π
π SEE ALSO π
okay this is the part where the manpage just lists, like, the entire scatterlist friend group and honestly? respect the hustle π they're all in the kernel file ./lib/scatterlist.c and here's the full squad, no one left out fr fr:
sg_nents(9)sg_nents_for_len(9)sg_nents_for_dma(9)sg_last(9)sg_init_table(9)sg_init_one(9)__sg_free_table(9)sg_free_append_table(9)sg_free_table(9)__sg_alloc_table(9)sg_alloc_table(9)sg_alloc_append_table_from_pages(9)sg_alloc_table_from_pages_segment(9)sgl_alloc_order(9)sgl_alloc(9)sgl_free_n_order(9)sgl_free_order(9)sgl_free(9)sg_miter_start(9)sg_miter_skip(9)sg_miter_next(9)sg_miter_stop(9)sg_copy_buffer(9)sg_copy_from_buffer(9)sg_copy_to_buffer(9)sg_pcopy_from_buffer(9)sg_pcopy_to_buffer(9)extract_iter_to_sg(9)
go read them all bestie, it's giving study group ππ
aaand that's the page!! π sign-off time: this one's from the ./lib section, dated October 2026, and it's sg_zero_buffer(9) β so if you ever forget, just remember: skip some bytes, zero some bytes, return the count. 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