Refactor exportDB!

This commit is contained in:
tarsin committed 2023-02-23 22:37:57 +08:00
1 parent a70b8c6dff
commit 1e7861ef15
3 files changed
+25 -41

No files matched your search

+9
View File
@@ -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);
}