mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +00:00
Fixed implementation for syscalls 200, 201 and 202
This commit is contained in:
parent
91e26d1a0e
commit
61cfed7916
@ -19,6 +19,8 @@ use libc::{
|
|||||||
fcntl,
|
fcntl,
|
||||||
// ENOTTY,
|
// ENOTTY,
|
||||||
fsync,
|
fsync,
|
||||||
|
getegid,
|
||||||
|
geteuid,
|
||||||
getgid,
|
getgid,
|
||||||
getgroups,
|
getgroups,
|
||||||
getpeername,
|
getpeername,
|
||||||
@ -347,28 +349,28 @@ pub fn ___syscall41(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int
|
|||||||
unsafe { dup(fd) }
|
unsafe { dup(fd) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getgid
|
/// getgid32
|
||||||
pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||||
debug!("emscripten::___syscall200 (getgid)");
|
debug!("emscripten::___syscall200 (getgid32)");
|
||||||
unsafe { getgid() as i32 }
|
unsafe { getgid() as i32 }
|
||||||
}
|
}
|
||||||
|
|
||||||
// getgid
|
// geteuid32
|
||||||
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||||
debug!("emscripten::___syscall201 (getgid)");
|
debug!("emscripten::___syscall201 (geteuid32)");
|
||||||
unsafe {
|
unsafe {
|
||||||
// Maybe fix: Emscripten returns 0 always
|
// Maybe fix: Emscripten returns 0 always
|
||||||
getgid() as i32
|
geteuid() as i32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// getgid32
|
// getegid32
|
||||||
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||||
// gid_t
|
// gid_t
|
||||||
debug!("emscripten::___syscall202 (getgid32)");
|
debug!("emscripten::___syscall202 (getegid32)");
|
||||||
unsafe {
|
unsafe {
|
||||||
// Maybe fix: Emscripten returns 0 always
|
// Maybe fix: Emscripten returns 0 always
|
||||||
getgid() as _
|
getegid() as _
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,23 +140,26 @@ pub fn ___syscall198(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int
|
|||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getgid
|
/// getgid32
|
||||||
pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||||
debug!("emscripten::___syscall200 (getgid)");
|
debug!("emscripten::___syscall200 (getgid32)");
|
||||||
unimplemented!()
|
|
||||||
|
getgid()
|
||||||
}
|
}
|
||||||
|
|
||||||
// getgid
|
// geteuid32
|
||||||
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||||
debug!("emscripten::___syscall201 (getgid)");
|
debug!("emscripten::___syscall201 (geteuid32)");
|
||||||
-1
|
|
||||||
|
geteuid()
|
||||||
}
|
}
|
||||||
|
|
||||||
// getgid32
|
// getegid32
|
||||||
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 {
|
||||||
// gid_t
|
// gid_t
|
||||||
debug!("emscripten::___syscall202 (getgid32)");
|
debug!("emscripten::___syscall202 (getegid32)");
|
||||||
-1
|
|
||||||
|
getegid()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getgroups
|
/// getgroups
|
||||||
|
Loading…
Reference in New Issue
Block a user