curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Feature-Request: sendfile(2)

From: Emil Engler via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 25 Feb 2021 12:10:57 +0100

Hello curl-library,
I recently thought about implementing the syscall sendfile(2) into
libcurl to speed up downloads to a file. For those of you who don't
know what it is:

sendfile() copies data between one file descriptor and another.
Because this copying is done within the kernel, sendfile() is more
efficient than the combination of read(2) and write(2),
which would require transferring data to and from user space.

From https://linux.die.net/man/2/sendfile

However implementing this syscall also raises some problems, including
limited support. AFAIK only Linux and FreeBSD support this syscall
(maybe even macOS as it inherited a lot from FreeBSD).
The lack of standardization also leads to the problem that the syscall
might differ on the platforms where it is supported.

So my idea would be to implement that feature and disable it for now
by using a configure option. Has someone already pitched the idea
in the past? If so, I would be happy for a link to this thread :-)

Cheers and a nice weekend,
Emil Engler
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-02-25