diff --git a/src/apis/emscripten/mod.rs b/src/apis/emscripten/mod.rs index 4578ddabc..05d5e952c 100644 --- a/src/apis/emscripten/mod.rs +++ b/src/apis/emscripten/mod.rs @@ -195,6 +195,16 @@ pub fn generate_emscripten_env<'a, 'b>() -> ImportObject<&'a str, &'b str> { "___syscall20", ImportValue::Func(syscalls::___syscall20 as *const u8), ); + import_object.set( + "env", + "___syscall64", + ImportValue::Func(syscalls::___syscall64 as *const u8), + ); + import_object.set( + "env", + "___syscall122", + ImportValue::Func(syscalls::___syscall122 as *const u8), + ); // Process import_object.set( "env", @@ -341,7 +351,7 @@ pub fn generate_emscripten_env<'a, 'b>() -> ImportObject<&'a str, &'b str> { mock_external!(import_object, ___syscall85); mock_external!(import_object, ___syscall75); mock_external!(import_object, ___syscall66); - mock_external!(import_object, ___syscall64); + // mock_external!(import_object, ___syscall64); mock_external!(import_object, ___syscall63); mock_external!(import_object, ___syscall60); mock_external!(import_object, ___syscall54); @@ -370,7 +380,7 @@ pub fn generate_emscripten_env<'a, 'b>() -> ImportObject<&'a str, &'b str> { // mock_external!(import_object, ___syscall145); mock_external!(import_object, ___syscall142); mock_external!(import_object, ___syscall140); - mock_external!(import_object, ___syscall122); + // mock_external!(import_object, ___syscall122); mock_external!(import_object, ___syscall102); // mock_external!(import_object, ___syscall20); mock_external!(import_object, ___syscall15); diff --git a/src/apis/emscripten/syscalls.rs b/src/apis/emscripten/syscalls.rs index ebdea81cf..36f666615 100644 --- a/src/apis/emscripten/syscalls.rs +++ b/src/apis/emscripten/syscalls.rs @@ -11,7 +11,7 @@ use libc::{ getsockname, getpeername, sendto, recvfrom, setsockopt, getsockopt, sendmsg, recvmsg, - msghdr, getpid, pid_t + msghdr, getpid, getppid, pid_t }; use macros; @@ -252,3 +252,11 @@ pub extern "C" fn ___syscall20() -> pid_t { getpid() } } + +// sys_getppid +pub extern "C" fn ___syscall64() -> pid_t { + debug!("emscripten::___syscall64"); + unsafe { + getpid() + } +}