You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/03/17 01:03:47 UTC

[GitHub] [tvm] tqchen commented on a change in pull request #7390: fix:getcwd not work on android platform

tqchen commented on a change in pull request #7390:
URL: https://github.com/apache/tvm/pull/7390#discussion_r595641218



##########
File path: apps/cpp_rpc/rpc_env.cc
##########
@@ -86,7 +86,13 @@ void CleanDir(const std::string& dirname);
 std::string BuildSharedLibrary(std::string file_in);
 
 RPCEnv::RPCEnv() {
-#ifndef _WIN32
+#if defined(ANDROID) || defined(__ANDROID__)
+  char cwd[PATH_MAX];
+  auto cmdline = fopen("/proc/self/cmdline", "r");
+  fread(cwd, 1, sizeof(cwd), cmdline);
+  fclose(cmdline);
+  base_ = "/data/data/" + std::string(cwd) + "/cache/rpc";
+#elif !defined(_WIN32)

Review comment:
       @csullivan great catch, can you send a new PR to fix this problem?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org