sg_copy_to_buffer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« sg_copy_to_buffer(9) πŸ’«

Ok bestie, welcome to the Kernel API Manual, section 9 β€” yes, the kernel kernel, main character energy only. Today's episode: sg_copy_to_buffer, aka "copy from an SG list to a linear buffer" (that's the NAME section, and yes it literally tells you the whole plot in one line πŸŽ€).


✨ SYNOPSIS ✨

size_t sg_copy_to_buffer (struct scatterlist *sgl , unsigned int nents ,
       void *buf , size_t buflen );

That's the whole signature, no cap β€” size_t in, size_t out, four args, periodt. πŸ’…


🌸 ARGUMENTS 🌸

  • sgl β€” the SG list. like, the list. the source of truth, the moment, the vibe. πŸ¦‹
  • nents β€” number of SG entries. how many of them we're actually dealing with, fr fr.
  • buf β€” where to copy to. the destination. the glow-up location. ⭐
  • buflen β€” the number of bytes to copy. that's your budget, bestie, don't overspend. πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

Returns the number of copied bytes.

That's it. That's the description. Short, iconic, ate and left no crumbs πŸ‘‘ β€” it takes your SG list and copies stuff into a linear buffer, and then hands you back a size_t telling you how many bytes actually made it. lowkey the most honest function in the kernel ngl.


πŸ”₯ SEE ALSO πŸ”₯

Buckle up babes, this is the friend group and it is huge 🫢. First, the location, in the kernel file ./lib/scatterlist.c:

bestie the way this list has twenty-eight entries and not one of them is filler 😭 go read them, iykyk.

ok that's the whole page, mwah πŸ’‹ β€” this lil masterpiece lives in ./lib, dated October 2026, and it's filed under sg_copy_to_buffer(9). see u in the next manpage, love u, bye πŸ§šπŸ’œ

πŸ“¦ where this page comes from