NativeMethods.cpp 886 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "il2cpp-config.h"
  2. #if IL2CPP_TARGET_POSIX && !RUNTIME_TINY
  3. #include "os/NativeMethods.h"
  4. #include "os/Process.h"
  5. #include "utils/Expected.h"
  6. namespace il2cpp
  7. {
  8. namespace os
  9. {
  10. bool NativeMethods::CloseProcess(ProcessHandle* handle)
  11. {
  12. IL2CPP_NOT_IMPLEMENTED_ICALL(NativeMethods::CloseProcess);
  13. IL2CPP_UNREACHABLE;
  14. return false;
  15. }
  16. utils::Expected<bool> NativeMethods::GetExitCodeProcess(ProcessHandle* handle, int32_t* exitCode)
  17. {
  18. IL2CPP_NOT_IMPLEMENTED_ICALL(NativeMethods::GetExitCodeProcess);
  19. IL2CPP_UNREACHABLE;
  20. return false;
  21. }
  22. int32_t NativeMethods::GetCurrentProcessId()
  23. {
  24. return Process::GetCurrentProcessId();
  25. }
  26. utils::Expected<ProcessHandle*> NativeMethods::GetCurrentProcess()
  27. {
  28. return Process::GetProcess(Process::GetCurrentProcessId());
  29. }
  30. }
  31. }
  32. #endif