aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Common/getExecutablePath.cpp
blob: d1ce3b18b8a8dcacc12371b05d345c3a6cdbe31e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <Common/getExecutablePath.h>
#include <filesystem>


std::string getExecutablePath()
{
    std::error_code ec;
    std::filesystem::path canonical_path = std::filesystem::canonical("/proc/self/exe", ec);

    if (ec)
        return {};
    return canonical_path;
}