skb_copy_datagram_from_iter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… skb_copy_datagram_from_iter(9) β€” a Kernel API Manual moment

okay bestie, welcome to the Kernel API Manual, section 9, and today's main character is skb_copy_datagram_from_iter. say it with me: copy a datagram from an iov_iter. that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

int skb_copy_datagram_from_iter (struct sk_buff *skb , int offset ,
       struct iov_iter *from , int len );

like, look at that signature. it's giving "i take four things and i return an int." iconic. πŸ”₯


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” the buffer you're copying into. the destination. the moment. 🫢
  • offset β€” where in the buffer you start copying to. yes, an offset in the buffer. not the source. the buffer. iykyk. ✨
  • from β€” the copy source, aka the iov_iter you're pulling from. the origin story. 🌸
  • len β€” how much data you want to copy to the buffer from the iovec. the amount. the quantity. the whole point. πŸ’–

🌈 DESCRIPTION 🌈

so what does it do? it returns 0 or -EFAULT. that's it. that's the description. no cap. πŸ’€

ngl the manpage is kinda quiet here β€” but that's literally all it says, so we're not gonna invent lore. 0 means slay, -EFAULT means the copy hit a bad address and said "not today." 😭

πŸ‘‘ SEE ALSO πŸ‘‘

if you're obsessed with this one (and why wouldn't you be), the kernel file is ./net/core/datagram.c and it's surrounded by absolute legends:

go read them. they're all in their own lane and they all ate. πŸ’…β­


and that's the page, bestie 🧚 β€” brought to you by the lovely folks over in ./net/core, dated October 2026, living under the Kernel API Manual name. see you in the next man 9. πŸ’œπŸŽ€

πŸ“¦ where this page comes from