We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6438305 commit d59e143Copy full SHA for d59e143
src/futils.cpp
@@ -375,13 +375,7 @@ std::string getProcessPath() {
375
ret = path;
376
}
377
#elif defined(__unix__)
378
- // http://stackoverflow.com/questions/606041/how-do-i-get-the-path-of-a-process-in-unix-linux
379
- char path[500];
380
- ssize_t l = readlink("/proc/self/exe", path, sizeof(path) - 1);
381
- if (l > 0) {
382
- path[l] = 0;
383
- ret = path;
384
- }
+ ret = std::filesystem::read_symlink("/proc/self/exe");
385
#endif
386
387
const size_t idxLastSeparator = ret.find_last_of(EXV_SEPARATOR_STR);
0 commit comments