mesalock-linux / mesabox

A collection of core system utilities written in Rust for Unix-like systems (and now Windows)
BSD 3-Clause "New" or "Revised" License
137 stars 19 forks source link

Add a wrapper for splice() #40

Open Arcterus opened 6 years ago

Arcterus commented 6 years ago

On Linux, we should try to use splice() rather than the standard read/write stuff for operations involving pipes. This mostly affects sh.

Arcterus commented 6 years ago

Depending on how far back we need to support we could use copy_file_range() for things as well (it doesn’t require one of the file descriptors to be a pipe, but it requires Linux 4.5).

Arcterus commented 6 years ago

It sounds like fs::copy() may already do this, so we might want to investigate a little more before deciding to add this.