From b87122db5892635c927e2261a83ae17b411167da Mon Sep 17 00:00:00 2001 From: Arie Karchmar Date: Sun, 7 Jul 2024 18:34:15 +0300 Subject: [PATCH] Allow skipping path resolution in task::get_exe() --- include/pfs/task.hpp | 2 +- src/task.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pfs/task.hpp b/include/pfs/task.hpp index dbdef3b..4a5cd14 100644 --- a/include/pfs/task.hpp +++ b/include/pfs/task.hpp @@ -59,7 +59,7 @@ class task final std::unordered_map get_environ(size_t max_size = 65536) const; - std::string get_exe() const; + std::string get_exe(bool resolve = true) const; size_t count_fds() const; diff --git a/src/task.cpp b/src/task.cpp index 9b141c4..30c012b 100644 --- a/src/task.cpp +++ b/src/task.cpp @@ -85,12 +85,12 @@ std::vector task::get_cgroups() const return output; } -std::string task::get_exe() const +std::string task::get_exe(bool resolve) const { static const std::string EXE_FILE("exe"); auto path = _task_root + EXE_FILE; - return utils::readlink(path); + return resolve ? utils::readlink(path) : path; } std::string task::get_cwd() const