| 82 | } |
| 83 | |
| 84 | fextl::string GetTempFolder() { |
| 85 | const std::array<const char*, 5> Vars = { |
| 86 | "XDG_RUNTIME_DIR", "TMPDIR", "TMP", "TEMP", "TEMPDIR", |
| 87 | }; |
| 88 | |
| 89 | for (auto& Var : Vars) { |
| 90 | auto Path = getenv(Var); |
| 91 | if (Path) { |
| 92 | // If one of the env variable-driven paths works then use that. |
| 93 | return Path; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // Fallback to `/tmp/` if no env vars are set. |
| 98 | // Might not be ideal but we don't have much of a choice. |
| 99 | return fextl::string {"/tmp"}; |
| 100 | } |
| 101 | |
| 102 | fextl::string GetServerMountFolder() { |
| 103 | // We need a FEXServer mount directory that has some tricky requirements. |
no test coverage detected