3 ms·
There also is splice: https://www.man7.org/linux/man-pages/man2/splice.2.html https://www.man7.org/linux/man-pages/man2/splice.2.html Which allows to move memo
by chme 2y ago
There also is splice: https://www.man7.org/linux/man-pages/man2/splice.2.html https://www.man7.org/linux/man-pages/man2/splice.2.html
Which allows to move memory from one process to the next using pipes without copying data. So maybe a bit of a mix between shared memory and pipes.
Maybe it would be interesting to see that in the comparison as well...
- duped 2y agoThe use case for splice is moving data from one file descriptor to another without reading it, for example port forwarding/mirroring (or taking over sendfile, dumping a file to a socket or socket to file). It doesn't cover IPC where you have messages that are actually being sent from one process to another and presumably, you want to read and write those bytes.
- Arnavion 2y ago>(or taking over sendfile, dumping a file to a socket or socket to file) splice only works if one of the two fds is a pipe. It cannot replace sendfile.
- duped 2y agoYou can do it with two calls to splice
- gpderetta 2y agoThat was the original implementation. I believe this has since been relaxed. I think the kernel will allocate a pipe internally in some cases. The man pages are known to be incomplete. In fact I think sendfile is implemented with the splice machinery now.
- IAmLiterallyAB 2y agoAlso vmsplice