获取进程名,含路径
std::string program_path() {
const int path_size = 512;
char *path = (char *)malloc(path_size);
if (path != NULL) {
if (readlink("/proc/self/exe", path, path_size) == -1) {
free(path);
path = NULL;
}
}
return std::string(path);
}
浙公网安备 33010602011771号