[PATCHv2] Use sendfile to copy data between file descriptors

Bartosz Gołaszewski bartekgola at gmail.com
Thu Nov 27 08:44:19 UTC 2014


2014-11-26 17:43 GMT+01:00 Denys Vlasenko <vda.linux at googlemail.com>:
> On Wed, Nov 26, 2014 at 4:06 PM, Denys Vlasenko
> <vda.linux at googlemail.com> wrote:
>> Looks like it will always allocate the copy buffer,
>> and always attempt the final read, even if sendfile worked perfectly.
>> Can this be avoided?
>
> Please review attached patch.

I can't compile it:

$ make
  CC      libbb/copyfd.o
libbb/copyfd.c: In function ‘bb_full_fd_action’:
libbb/copyfd.c:66:11: error: assignment to expression with array type
    buffer = mmap(NULL, CONFIG_FEATURE_COPYBUF_KB * 1024,
           ^
libbb/copyfd.c:70:16: error: lvalue required as left operand of assignment
    buffer_size = CONFIG_FEATURE_COPYBUF_KB * 1024;
                ^
libbb/copyfd.c:73:12: error: assignment to expression with array type
     buffer = alloca(4 * 1024);
            ^
libbb/copyfd.c:74:17: error: lvalue required as left operand of assignment
     buffer_size = 4 * 1024;
                 ^

Bart


More information about the busybox mailing list