Code cleanup (#251)
[platform/core/dotnet/launcher.git] / NativeLauncher / launcher / lib / dotnet_launcher.cc
index 2e1bfe6..0a32533 100644 (file)
@@ -265,6 +265,18 @@ static void setLang()
        free(lang);
 }
 
+static std::string readSelfPath()
+{
+       char buff[PATH_MAX];
+       ssize_t len = ::readlink("/proc/self/exe", buff, sizeof(buff)-1);
+       if (len != -1) {
+               buff[len] = '\0';
+               return std::string(buff);
+       }
+
+       return "";
+}
+
 void CoreRuntime::preload()
 {
        typedef void (*PreloadDelegate)();