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); }
posted on 2022-08-04 14:33 lialin 阅读(37) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 lialin Powered by .NET 9.0 on Kubernetes