more optimizing imports

This commit is contained in:
Mackenzie Clark
2019-03-21 11:54:55 -07:00
parent 59ed6a91d8
commit 825926f40a
3 changed files with 84 additions and 83 deletions

View File

@ -35,27 +35,6 @@ use libc::wait4;
//#[cfg(not(target_os = "darwin"))]
//const SO_NOSIGPIPE: c_int = 0;
// getgid
//#[cfg(not(feature = "vfs"))]
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::___syscall201 (getgid)");
let result = unsafe {
// Maybe fix: Emscripten returns 0 always
libc::getgid() as i32
};
result
}
// getgid32
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
// gid_t
debug!("emscripten::___syscall202 (getgid32)");
unsafe {
// Maybe fix: Emscripten returns 0 always
libc::getgid() as _
}
}
/// wait4
#[allow(clippy::cast_ptr_alignment)]
pub fn ___syscall114(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> pid_t {
@ -92,6 +71,26 @@ pub fn ___syscall122(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_in
unsafe { uname(buf_addr) }
}
/// getgid
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
debug!("emscripten::___syscall201 (getgid)");
let result = unsafe {
// Maybe fix: Emscripten returns 0 always
libc::getgid() as i32
};
result
}
/// getgid32
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
// gid_t
debug!("emscripten::___syscall202 (getgid32)");
unsafe {
// Maybe fix: Emscripten returns 0 always
libc::getgid() as _
}
}
/// chown
pub fn ___syscall212(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int {
debug!("emscripten::___syscall212 (chown) {}", _which);