1 .TH splice 2 2006-04-28 "Linux 2.6.17" "Linux Programmer's Manual"
3 splice \- splice data to/from a pipe.
5 .B #include <sys/splice.h>
7 .B long splice(int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t bytes, unsigned int flags);
10 The act of splicing can be seen as a way to connect two ends of a rope
11 through a kernel buffer, where that buffer is implemented as a pipe. It
12 provides a means to move data around without copying it to/from kernel/user
13 address space, basically a random kernel buffer that the user has full
20 of data between file descriptor
24 where one of the descriptors must refer to a pipe. The
26 argument is a series of modifier flags:
30 Attempt to move pages instead of copying. This is only a hint to the kernel,
31 pages may still be copied if we fail in stealing it out of the pipe or if
32 the pipe buffers don't refer to full pages.
38 More data will be coming in a subsequent splice. This is a helpful hint when
39 the output descriptor refers to a socket, see also
52 Upon successful completion,
54 shall return the number of bytes
55 spliced to or from the pipe. Otherwise, it shall return a value of -1 and
57 shall be set to indicate an error.
62 File descriptors either not valid, or do not have proper rw permission.
65 Target file system doesn't support splicing, none of the descriptors refer
66 to a pipe or offset given for non-seekable device.
74 system call first appeared in Linux-2.6.17.
81 Jens Axboe <axboe@kernel.dk>