Commit | Line | Data |
---|---|---|
f758e908 JA |
1 | .TH vmsplice 2 2006-04-28 "Linux 2.6.17" "Linux Programmer's Manual" |
2 | .SH NAME | |
3 | vmsplice \- splice user pages into a pipe | |
4 | .SH SYNOPSIS | |
5 | .B #include <sys/uio.h> | |
6 | ||
7 | .B long vmsplice(int fd, const struct iovec *iov, unsigned long nr_segs, unsigned ing flags); | |
8 | ||
9 | .SH DESCRIPTION | |
10 | The \fIvmsplice\fR() function maps \fInr_segs\fR range(s) of \fIiov\fR described user memory into a pipe. The \fIfd\fR must refer to a pipe. | |
11 | ||
12 | The pointer \fIiov\fR points to an array of \fIstruct iovec\fR entries as | |
13 | defined in \fI<sys/uio.h>\fR: | |
14 | ||
15 | .nf | |
16 | struct iovec { | |
17 | void *iov_base; /* Starting address */ | |
18 | size_t iov_len; /* Number of bytes */ | |
19 | }; | |
20 | .fi | |
21 | ||
22 | The \fIflags\fR argument is a series of modifier flags. Only | |
23 | .B SPLICE_F_NONBLOCK | |
24 | and | |
25 | .B SPLICE_F_GIFT | |
26 | really apply to \fIvmsplice\fR(), the but the scope is shared with | |
27 | \fBsplice\fR(). | |
28 | ||
29 | .TP 1.9i | |
30 | .B SPLICE_F_MOVE | |
31 | Attempt to move pages instead of copying. | |
32 | .TP | |
33 | .B SPLICE_F_NONBLOCK | |
34 | Do not block on io. | |
35 | .TP | |
36 | .B SPLICE_F_MORE | |
37 | More data will be coming in a subsequent splice. | |
38 | .TP | |
39 | .B SPLICE_F_GIFT | |
40 | The user pages are a gift to the kernel. The application may not reuse this | |
41 | memory ever, or page cache and on disk data may differ. Data must also be | |
42 | properly page aligned. | |
43 | ||
44 | .SH RETURN VALUE | |
45 | Upon successful completion, \fIvmsplice\fR() shall return the number of bytes | |
46 | spliced to the pipe. Otherwise, it shall return a value of -1 and \fIerrno\fR | |
47 | shall be set to indicate an error. | |
48 | ||
49 | .SH ERRORS | |
50 | .B EBADF \fIfd\fR either not valid, or doesn't refer to a pipe. | |
51 | .TP 7 | |
52 | .B EINVAL \fInr_segs\fR not valid, memory not aligned if \fISPLICE_F_GIFT\fR | |
53 | set. | |
54 | ||
55 | .SH NOTES | |
56 | \fIvmsplice\fR() follows the other vectorized read/write type functions when | |
57 | it comes to limitations on number of segments being passed in. This limit | |
58 | is \fBIOV_MAX\fR as defined in \fI<limits.h>\fR. At the time of this writing, | |
59 | that limit is 1024. | |
60 | ||
61 | .SH AUTHORS | |
62 | Jens Axboe <axboe@suse.de> |