stub out/add the rest

This commit is contained in:
Mark McCaskey
2019-03-20 16:46:42 -07:00
parent d13e4aa71f
commit c58a7e0c37
7 changed files with 150 additions and 1 deletions

View File

@ -1,4 +1,4 @@
use libc::printf as _printf;
use libc::{chroot as _chroot, printf as _printf};
use wasmer_runtime_core::vm::Ctx;
@ -15,3 +15,60 @@ pub fn printf(ctx: &mut Ctx, memory_offset: i32, extra: i32) -> i32 {
_printf(addr, extra)
}
}
/// chroot
pub fn chroot(ctx: &mut Ctx, name_ptr: i32) -> i32 {
let name = emscripten_memory_pointer!(ctx.memory(0), name_ptr) as *const i8;
unsafe { _chroot(name) }
}
/// getprotobyname
pub fn getprotobyname(ctx: &mut Ctx, name_ptr: i32) -> i32 {
debug!("emscripten::getprotobyname");
// TODO: actually do this logic to return correctly
let _name = emscripten_memory_pointer!(ctx.memory(0), name_ptr) as *const i8;
//unsafe { _getprotobyname(name) as i32 }
0
}
/// getprotobynumber
pub fn getprotobynumber(_ctx: &mut Ctx, _one: i32) -> i32 {
debug!("emscripten::getprotobynumber");
0
}
// REVIEW: does this belong here?
/// getpwuid
pub fn getpwuid(_ctx: &mut Ctx, _uid: i32) -> i32 {
debug!("emscripten::getpwuid");
// TODO: actually do this logic to return correctly
0
}
/// longjmp
pub fn longjmp(_ctx: &mut Ctx, _one: i32, _two: i32) {
debug!("emscripten::longjump");
}
/// sigdelset
pub fn sigdelset(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::sigdelset");
0
}
/// sigfillset
pub fn sigfillset(_ctx: &mut Ctx, _one: i32) -> i32 {
debug!("emscripten::sigfillset");
0
}
/// tzset
pub fn tzset(_ctx: &mut Ctx) {
debug!("emscripten::tzset");
}
/// strptime
pub fn strptime(_ctx: &mut Ctx, _one: i32, _two: i32, _three: i32) -> i32 {
debug!("emscripten::strptime");
0
}