diff --git a/lib/emscripten/src/syscalls/unix.rs b/lib/emscripten/src/syscalls/unix.rs index 0815251b6..9880c4b5b 100644 --- a/lib/emscripten/src/syscalls/unix.rs +++ b/lib/emscripten/src/syscalls/unix.rs @@ -19,6 +19,8 @@ use libc::{ fcntl, // ENOTTY, fsync, + getegid, + geteuid, getgid, getgroups, getpeername, @@ -347,28 +349,28 @@ pub fn ___syscall41(ctx: &mut Ctx, _which: c_int, mut varargs: VarArgs) -> c_int unsafe { dup(fd) } } -/// getgid +/// getgid32 pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 { - debug!("emscripten::___syscall200 (getgid)"); + debug!("emscripten::___syscall200 (getgid32)"); unsafe { getgid() as i32 } } -// getgid +// geteuid32 pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 { - debug!("emscripten::___syscall201 (getgid)"); + debug!("emscripten::___syscall201 (geteuid32)"); unsafe { // 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 { // gid_t - debug!("emscripten::___syscall202 (getgid32)"); + debug!("emscripten::___syscall202 (getegid32)"); unsafe { // Maybe fix: Emscripten returns 0 always - getgid() as _ + getegid() as _ } } diff --git a/lib/emscripten/src/syscalls/windows.rs b/lib/emscripten/src/syscalls/windows.rs index b48303358..e0004a383 100644 --- a/lib/emscripten/src/syscalls/windows.rs +++ b/lib/emscripten/src/syscalls/windows.rs @@ -140,23 +140,26 @@ pub fn ___syscall198(_ctx: &mut Ctx, _which: c_int, _varargs: VarArgs) -> c_int unimplemented!() } -/// getgid +/// getgid32 pub fn ___syscall200(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 { - debug!("emscripten::___syscall200 (getgid)"); - unimplemented!() + debug!("emscripten::___syscall200 (getgid32)"); + + getgid() } -// getgid +// geteuid32 pub fn ___syscall201(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 { - debug!("emscripten::___syscall201 (getgid)"); - -1 + debug!("emscripten::___syscall201 (geteuid32)"); + + geteuid() } -// getgid32 +// getegid32 pub fn ___syscall202(_ctx: &mut Ctx, _one: i32, _two: i32) -> i32 { // gid_t - debug!("emscripten::___syscall202 (getgid32)"); - -1 + debug!("emscripten::___syscall202 (getegid32)"); + + getegid() } /// getgroups