| 3051 | #define getcwd(buf, maxlen) _getcwd(buf, maxlen) |
| 3052 | #endif |
| 3053 | std::string getWorkingDirectory() { |
| 3054 | char* buf; |
| 3055 | if ((buf = getcwd(nullptr, 0)) == nullptr) { |
| 3056 | TraceEvent(SevWarnAlways, "GetWorkingDirectoryError").GetLastError(); |
| 3057 | throw platform_error(); |
| 3058 | } |
| 3059 | std::string result(buf); |
| 3060 | free(buf); |
| 3061 | return result; |
| 3062 | } |
| 3063 | |
| 3064 | } // namespace platform |
| 3065 |