add more; get it working

This commit is contained in:
Mark McCaskey
2019-03-25 11:58:44 -07:00
parent f66b024390
commit 4f98da710d
5 changed files with 96 additions and 7 deletions

View File

@ -1,4 +1,4 @@
use libc::{chroot as _chroot, printf as _printf};
use libc::{chroot as _chroot, printf as _printf, getpwuid as _getpwuid};
use wasmer_runtime_core::vm::Ctx;
@ -22,3 +22,10 @@ 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) }
}
/// getpwuid
pub fn getpwuid(_ctx: &mut Ctx, uid: i32) -> i32 {
debug!("emscripten::getpwuid");
// REVIEW: this seems wrong
unsafe { _getpwuid(uid as u32) as _ }
}