add more functions for sqlite compiled from config src

This commit is contained in:
Mark McCaskey 2019-03-25 13:09:23 -07:00
parent 2969989ecd
commit 3500d5a7c7
4 changed files with 53 additions and 3 deletions

View File

@ -283,6 +283,9 @@ pub fn nullFunc_iiij(_ctx: &mut Ctx, _index: i32) {
pub fn nullFunc_iijii(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_iijii");
}
pub fn nullFunc_iijj(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_iijj");
}
pub fn nullFunc_iiiiji(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_iiiiji");
}
@ -337,11 +340,14 @@ pub fn nullFunc_viiijiiiiii(_ctx: &mut Ctx, _index: i32) {
pub fn nullFunc_viij(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_viij");
}
pub fn nullFunc_viijii(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_viijii");
}
pub fn nullFunc_viiji(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_viiji");
}
pub fn nullFunc_viijii(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_viijii");
pub fn nullFunc_vijii(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_vijii");
}
pub fn nullFunc_viijiii(_ctx: &mut Ctx, _index: i32) {
debug!("emscripten::nullFunc_viijiii");

View File

@ -515,6 +515,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
"___syscall142" => func!(crate::syscalls::___syscall142),
"___syscall145" => func!(crate::syscalls::___syscall145),
"___syscall146" => func!(crate::syscalls::___syscall146),
"___syscall148" => func!(crate::syscalls::___syscall148),
"___syscall168" => func!(crate::syscalls::___syscall168),
"___syscall180" => func!(crate::syscalls::___syscall180),
"___syscall181" => func!(crate::syscalls::___syscall181),
@ -540,6 +541,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
"___syscall272" => func!(crate::syscalls::___syscall272),
"___syscall295" => func!(crate::syscalls::___syscall295),
"___syscall300" => func!(crate::syscalls::___syscall300),
"___syscall324" => func!(crate::syscalls::___syscall324),
"___syscall330" => func!(crate::syscalls::___syscall330),
"___syscall334" => func!(crate::syscalls::___syscall334),
"___syscall340" => func!(crate::syscalls::___syscall340),
@ -685,6 +687,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
"nullFunc_diiii" => func!(crate::emscripten_target::nullFunc_diiii),
"nullFunc_iiid" => func!(crate::emscripten_target::nullFunc_iiid),
"nullFunc_iiji" => func!(crate::emscripten_target::nullFunc_iiji),
"nullFunc_iijj" => func!(crate::emscripten_target::nullFunc_iijj),
"nullFunc_iij" => func!(crate::emscripten_target::nullFunc_iij),
"nullFunc_ij" => func!(crate::emscripten_target::nullFunc_ij),
"nullFunc_j" => func!(crate::emscripten_target::nullFunc_j),
@ -710,6 +713,7 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
"nullFunc_viiijiiiiii" => func!(crate::emscripten_target::nullFunc_viiijiiiiii),
"nullFunc_viij" => func!(crate::emscripten_target::nullFunc_viij),
"nullFunc_viiji" => func!(crate::emscripten_target::nullFunc_viiji),
"nullFunc_vijii" => func!(crate::emscripten_target::nullFunc_vijii),
"nullFunc_viijii" => func!(crate::emscripten_target::nullFunc_viijii),
"nullFunc_viiiij" => func!(crate::emscripten_target::nullFunc_viiiij),
"nullFunc_viijiii" => func!(crate::emscripten_target::nullFunc_viijiii),

View File

@ -36,6 +36,7 @@ use libc::{
mode_t,
msghdr,
nice,
off_t,
open,
pid_t,
pread,
@ -80,10 +81,11 @@ use std::mem;
extern "C" {
pub fn wait4(pid: pid_t, status: *mut c_int, options: c_int, rusage: *mut rusage) -> pid_t;
pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int;
pub fn fdatasync(fd: c_int) -> c_int;
}
#[cfg(not(target_os = "macos"))]
use libc::{madvise, wait4};
use libc::{fallocate, fdatasync, madvise, wait4};
// Another conditional constant for name resolution: Macos et iOS use
// SO_NOSIGPIPE as a setsockopt flag to disable SIGPIPE emission on socket.
@ -709,6 +711,15 @@ pub fn ___syscall142(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
unsafe { select(nfds, readfds_ptr, writefds_ptr, 0 as _, 0 as _) }
}
/// fdatasync
pub fn ___syscall148(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall148 (fdatasync) {}", _which);
let fd: i32 = varargs.get(ctx);
unsafe { fdatasync(fd) }
}
// setpgid
pub fn ___syscall57(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall57 (setpgid) {}", _which);
@ -726,3 +737,20 @@ pub fn ___syscall122(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
let buf_addr = emscripten_memory_pointer!(ctx.memory(0), buf) as *mut utsname;
unsafe { uname(buf_addr) }
}
/// fallocate
pub fn ___syscall324(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall324 (fallocate) {}", _which);
let _fd: c_int = varargs.get(ctx);
let _mode: c_int = varargs.get(ctx);
let _offset: off_t = varargs.get(ctx);
let _len: off_t = varargs.get(ctx);
#[cfg(not(target_os = "macos"))]
unsafe {
fallocate(_fd, _mode, _offset, _len)
}
#[cfg(target_os = "macos")]
{
unimplemented!()
}
}

View File

@ -216,6 +216,12 @@ pub fn ___syscall142(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_i
-1
}
/// fdatasync
pub fn ___syscall148(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall148 (fdatasync) {}", _which);
unimplemented!();
}
// setpgid
pub fn ___syscall57(_ctx: &mut Ctx, which: c_int, mut _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall57 (setpgid) {}", which);
@ -238,3 +244,9 @@ pub fn ___syscall207(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int
debug!("emscripten::___syscall207 (fchown) {}", _which);
unimplemented!()
}
/// fallocate
pub fn ___syscall324(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall324 (fallocate) {}", _which);
unimplemented!()
}