From sendfile(2):
Currently (Linux 2.6.9): in_fd, must correspond to a file that supports mmap () - similar operations (i.e. it cannot be a socket); and out_fd should refer to the socket.
So, it looks like the answer is no.
Edit
I think I understand what you are looking for now. Check it out splice(2).
source
share