libbb: use sendfile() to copy data between file descriptors
authorBartosz Golaszewski <bartekgola@gmail.com>
Thu, 27 Nov 2014 12:20:24 +0000 (13:20 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 27 Nov 2014 22:31:58 +0000 (23:31 +0100)
commit8d75d794ea505003fddea8e757d43976db8d6861
tree0aae42250953ae1de36666aa5fc12a11ad3be02f
parentee41094b809452fdd23d25c1879a96acfcddde08
libbb: use sendfile() to copy data between file descriptors

Busybox already uses sendfile in httpd. This patch proposes to use it
globally to copy data between file descriptors.

It speeds up the copying on slow systems a lot - below are the times needed
to copy a 450Mb file with and without this option enabled on a BeagleBone
Black:

sendfile:
user    0m0.000s
sys     0m8.170s

read/write 4k:
user    0m0.470s
sys     0m16.300s

function                                             old     new   delta
bb_full_fd_action                                    394     474     +80

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Config.in
libbb/copyfd.c
networking/Config.src
networking/httpd.c