Chromium Code Reviews| Index: runtime/bin/platform_openbsd.cc |
| diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_openbsd.cc |
| similarity index 91% |
| copy from runtime/bin/platform_linux.cc |
| copy to runtime/bin/platform_openbsd.cc |
| index 24cbfd3ebf58bd840cfffdfb17784544ffb332c7..3c01ae0f0cd3e735c2ae666e8b8790bdc566c193 100644 |
| --- a/runtime/bin/platform_linux.cc |
| +++ b/runtime/bin/platform_openbsd.cc |
| @@ -3,7 +3,7 @@ |
| // BSD-style license that can be found in the LICENSE file. |
| #include "platform/globals.h" |
| -#if defined(TARGET_OS_LINUX) |
| +#if defined(TARGET_OS_OPENBSD) |
| #include "bin/file.h" |
| #include "bin/platform.h" |
| @@ -14,6 +14,7 @@ |
| #include "bin/fdutils.h" |
| +extern char **environ; |
| namespace dart { |
| namespace bin { |
| @@ -39,7 +40,7 @@ int Platform::NumberOfProcessors() { |
| const char* Platform::OperatingSystem() { |
| - return "linux"; |
| + return "openbsd"; |
| } |
| @@ -74,6 +75,7 @@ void Platform::FreeEnvironment(char** env, intptr_t count) { |
| char* Platform::ResolveExecutablePath() { |
| + // TODO(mulander): There is no procfs on OpenBSD - find a workaround |
|
Ivan Posva
2016/01/11 23:58:40
Would remembering arg[0] in main.cc work? It is no
mulander
2016/01/12 00:22:45
There is an example implementation in Go I want to
|
| return File::LinkTarget("/proc/self/exe"); |
| } |
| @@ -84,4 +86,4 @@ void Platform::Exit(int exit_code) { |
| } // namespace bin |
| } // namespace dart |
| -#endif // defined(TARGET_OS_LINUX) |
| +#endif // defined(TARGET_OS_OPENBSD) |