Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sendfile() usage on two mmaped files (linux)

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

like image 620
osgx Avatar asked Oct 16 '25 15:10

osgx


1 Answers

From sendfile(2):

Presently (Linux 2.6.9): in_fd, must correspond to a file which supports mmap()-like operations (i.e., it cannot be a socket); and out_fd must refer to a socket.

So it looks like the answer is no.

Edit

I think I understand what you are looking for now. Check out splice(2).

like image 149
Nikolai Fetissov Avatar answered Oct 19 '25 06:10

Nikolai Fetissov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!