Files
systemd/src/basic
Zbigniew Jędrzejewski-Szmek 00a8cf7763 basic/copy: use sendfile smarter
We called sendfile with 16kb (a.k.a. COPY_BUFFER_SIZE) as the maximum
number of bytes to copy. This seems rather inefficient, especially with
large files. Instead, call sendfile with a "large" maximum.

What "large" max means is a bit tricky: current file offset + max
must fit in loff_t. This means that as we call sendfile more than once,
we have to lower the max size.

With this patch, test-copy calls sendfile twice, e.g.:
sendfile(4, 3, NULL, 9223372036854775807) = 738760
sendfile(4, 3, NULL, 9223372036854037047) = 0
The second call is necessary to determine EOF.
2016-03-15 14:54:27 -04:00
..
2016-02-19 01:36:46 +06:00
2015-12-07 18:34:05 +01:00
2015-12-07 18:34:05 +01:00
2016-03-15 14:54:27 -04:00
2015-11-30 21:51:03 +01:00
2015-11-18 23:09:02 +01:00
2015-11-30 21:51:03 +01:00
2015-12-01 23:40:17 +01:00