]> gitweb.ps.run Git - ps-cgit/commitdiff
cache: use sendfile() instead of a pair of read() + write()
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Sat, 18 Jan 2014 20:24:58 +0000 (21:24 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 19 Jan 2014 14:08:49 +0000 (15:08 +0100)
sendfile() does the same job and avoids to copy the content into userland
and back. One has to define NO_SENDFILE in case the OS (kernel / libc)
does not supported. It is disabled by default on non-linux environemnts.
According to the glibc, sendfile64() was added in Linux 2.4 (so it has
been there for a while) but after browsing over the mapage of FreeBSD's I
noticed that the prototype is little different.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>

No differences found