Conill: How efficient can cat(1) be?
Ariadne Conill exploresways to make the Unix cat utility more efficient onLinux.
The first possible option is the venerable sendfile syscall, whichwas originally added to improve the file serving performance of webservers. Originally, sendfile required the destination filedescriptor to be a socket, but this restriction was removed inLinux 2.6.33. Unfortunately, sendfile is not perfect: because itonly supports file descriptors which can be memory mapped, we mustuse a different strategy when using copying from stdin.