---
name: "zerocopy_sg_from_iovec"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/zerocopy_sg_from_iovec"
---

# zerocopy\_sg\_from\_iovec(9)

Build a zerocopy datagram from an iovec

## NAME

zerocopy\_sg\_from\_iovec - Build a zerocopy datagram from an iovec

## SYNOPSIS

**int zerocopy\_sg\_from\_iovec(struct sk\_buff \*** *skb***, const struct iovec \*** *from***, int** *offset***, size\_t** *count***);**

## ARGUMENTS

*skb*

buffer to copy

*from*

io vector to copy from

*offset*

offset in the io vector to start copying from

*count*

amount of vectors to copy to buffer from

## DESCRIPTION

The function will first copy up to headlen, and then pin the userspace pages and build frags through them.

Returns 0, -EFAULT or -EMSGSIZE.

## NOTE

the iovec is not modified during the copy

## COPYRIGHT
