cache: use sendfile() instead of a pair of read() + write()
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>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Jason A. Donenfeld

vecāks
ea7210bef3
revīzija
d3581b5889
1
Makefile
1
Makefile
@ -29,6 +29,7 @@ DOC_PDF = $(patsubst %.txt,%.pdf,$(MAN_TXT))
|
||||
# j, z, t. (representing long long int, char, intmax_t, size_t, ptrdiff_t).
|
||||
# some C compilers supported these specifiers prior to C99 as an extension.
|
||||
#
|
||||
# Define HAVE_LINUX_SENDFILE to use sendfile()
|
||||
|
||||
#-include config.mak
|
||||
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user