| 70 | }; |
| 71 | |
| 72 | void Init() { |
| 73 | for (auto Path : TraceFSDirectories) { |
| 74 | #ifdef _WIN32 |
| 75 | constexpr auto flags = O_WRONLY; |
| 76 | #else |
| 77 | constexpr auto flags = O_WRONLY | O_CLOEXEC; |
| 78 | #endif |
| 79 | fextl::string FilePath = fextl::fmt::format("{}/trace_marker", Path); |
| 80 | TraceFD = open(FilePath.c_str(), flags); |
| 81 | if (TraceFD != -1) { |
| 82 | // Opened TraceFD, early exit |
| 83 | break; |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | void Shutdown() { |
| 89 | if (TraceFD != -1) { |