Safe Haskell | Safe-Infered |
---|
Exposes the GNU/Linux system call splice()
.
This module is only available (compiled & exposed) on Linux.
Documentation
:: Fd |
|
-> Ptr Int64 |
|
-> Fd |
|
-> Ptr Int64 |
|
-> ChunkSize |
|
-> Word |
|
-> IO Int32 | number of bytes moved if successful; otherwise -1. |
Moves data between two file descriptors without copying between kernel
address space and user address space. It transfers up to len
bytes of
data from the file descriptor fd_in
to the file descriptor fd_out
,
where one of the descriptors must refer to a pipe.
c_splice
is NOT a loop and needs to be called repeatedly.
For an example, see splice
.
The numeric type used by c_splice
for chunk size recommendations when
moving data.
Attempt to move pages instead of copying. This is only a hint to the kernel: pages may stil be copied (in kernel address space) if the kernel cannot move the pages from the pipe, or if the pipe buffers don't refer to full pages.
More data will be coming in a subsequent splice. This is a helpful hint
when fd_out
refers to a socket.
sPLICE_F_NONBLOCK :: WordSource
Do not block on I/O. This makes the splice pipe operations nonblocking, but splice() may nevertheless block because the file descriptors that are spliced to/from may block (unless they have the O_NONBLOCK flag set).