Does Android support splice() and sendfile()?
-
I don't see how this question could possibly be considered unclear, even in its original unedited form. Upvoted and upvoted answer. – Warren Dew May 30 '15 at 00:35
2 Answers
These are Linux kernel calls, so they do exist on Android.
The more interesting question is if Bionic libc provides wrappers as it does for most ordinarily used system calls, or if you will have to invoke them directly. Additionally, apart from being included in Bionic there is the question of the functionality being exported for general use in the NDK.
It appears that sendfile() has been there since the first NDK release.
splice() has not historically seemed to be part of the NDK (I did not check the latest), though it was added to the AOSP sources of Bionic libc in June 2014.
Incidentally grep -r
on relevant parts of the NDK installation and/or an AOSP Bionic checkout is a quick way to look into things like this.

- 39,853
- 6
- 84
- 117
-
see here: https://android.googlesource.com/platform/bionic/+/master/libc/SYSCALLS.TXT – NorbertM Mar 08 '22 at 11:01
Ndk doesn't support splice(). When I was trying to compile dirtypipe exploit for android.
-
1Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 21 '22 at 18:50