Function std::sys::unix::kernel_copy::safe_kernel_copy
source · fn safe_kernel_copy(source: &FdMeta, sink: &FdMeta) -> bool
Expand description
Returns true either if changes made to the source after a sendfile/splice call won’t become visible in the sink or the source has explicitly opted into such behavior (e.g. by splicing a file into a pipe, the pipe being the source in this case).
This will prevent File -> Pipe and File -> Socket splicing/sendfile optimizations to uphold the Read/Write API semantics of io::copy.
Note: This is not 100% airtight, the caller can use the RawFd conversion methods to turn a regular file into a TcpSocket which will be treated as a socket here without checking.