skb_copy_datagram_from_iter(9)
π 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 theiov_iteryou'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.0means slay,-EFAULTmeans 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:
__skb_try_recv_datagram(9)skb_kill_datagram(9)skb_copy_and_crc32c_datagram_iter(9)skb_copy_datagram_iter(9)zerocopy_sg_from_iter(9)skb_copy_and_csum_datagram(9)skb_copy_and_csum_datagram_msg(9)datagram_poll_queue(9)datagram_poll(9)
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
- 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