skb_zerocopy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, this is skb_zerocopy(9) from the Kernel API Manual, and the name is literally skb_zerocopy β€” Zero copy skb to skb ✨

🌈 SYNOPSIS 🌈

int skb_zerocopy (struct sk_buff *to , struct sk_buff *from , int len ,
       int hlen );

πŸŽ€ ARGUMENTS πŸŽ€

  • to β€” destination buffer
  • from β€” source buffer
  • len β€” number of bytes to copy from source buffer
  • hlen β€” size of linear headroom in destination buffer

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the way this works is: it copies up to len bytes from from to to by creating references to the frags in the source buffer. lowkey iconic, zero-copy behavior πŸ’…

The hlen, as calculated by skb_zerocopy_headlen, specifies the headroom in the to buffer. vibes = headroom, honestly πŸŽ€

Return value, bestie:

  • 0 β€” everything is OK
  • -ENOMEM β€” couldn't orphan frags of from due to lack of memory
  • -EFAULT β€” skb_copy_bits found some problem with skb geometry, or readable head payload would be mixed with unreadable frags

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./net/core/skbuff.c is the spot, and the whole reference squad is:


mwah πŸ’‹ this skb_zerocopy(9) page is from ./net/core and is dated October 2026 β€” catch u in the kernel, bestie 🫢

πŸ“¦ where this page comes from