The functions implement copying data between two file descriptors
using copy_file_range(2) and handle fall back to read(2)/write(2)
when copy_file_range(2) cannot be used.
The function should be called in a loop until it returns > 0.
The fcopydata_sig() function (undocumented) takes additional argument
that indicates a signal has been recieved by the program and we should
return as soon as possible. This is only used in the fallback code.
When signal is delivered during copy_file_range(2) the function will
always return.
Use fcopydata()/fcopydata_sig() in cat(1), cp(1), mv(1) and install(1).
While here, improve progress reporting in cp(1) and add progress
reporting to mv(1) when SIGINFO is received:
- Don't report progress in percent when we are not copying a regular file as the size won't be available and it makes no sense.
- Report also number of bytes copies (and total bytes to be copied when available). Because we now link libutil, report those using humanize_number(3).