Sendfile () for two mmaped files (linux)

Can sendfile () linux syscall be used to send part of a file from one mmaped file to another mmaped file?

+3
source share
1 answer

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).

+3
source

Source: https://habr.com/ru/post/1738979/


All Articles