Refactor exportDB!
This commit is contained in:
1 parent
a70b8c6dff
commit
1e7861ef15
3 files changed
+25
-41
No files matched your search
@@ -1,5 +1,7 @@
|
||||
#include <jni.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/sendfile.h>
|
||||
|
||||
#include <android/log.h>
|
||||
#include <string.h>
|
||||
@@ -25,3 +27,10 @@ Java_com_hippo_Native_getFd(JNIEnv *env, jclass clazz, jobject fileDescriptor) {
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_hippo_Native_sendfile(JNIEnv *env, jclass clazz, jint from, jint to) {
|
||||
struct stat st;
|
||||
fstat(from, &st);
|
||||
sendfile(to, from, 0, st.st_size);
|
||||
}
|
||||
Reference in new issue
Block a user