File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ class task final
96
96
std::vector<id_map> get_uid_map () const ;
97
97
std::vector<id_map> get_gid_map () const ;
98
98
99
+ uint32_t get_sessionid () const ;
100
+
99
101
private:
100
102
friend class procfs ;
101
103
task (const std::string& procfs_root, int id);
Original file line number Diff line number Diff line change 33
33
#include " pfs/parsers/mountinfo.hpp"
34
34
#include " pfs/parsers/lines.hpp"
35
35
#include " pfs/parsers/common.hpp"
36
+ #include " pfs/parsers/number.hpp"
36
37
#include " pfs/parsers/task_io.hpp"
37
38
#include " pfs/parsers/task_status.hpp"
38
39
#include " pfs/task.hpp"
@@ -489,4 +490,15 @@ std::vector<id_map> task::get_gid_map() const
489
490
return output;
490
491
}
491
492
493
+ uint32_t task::get_sessionid () const
494
+ {
495
+ static const std::string SESSION_ID_FILE (" sessionid" );
496
+ auto path = _task_root + SESSION_ID_FILE;
497
+
498
+ auto line = utils::readline (path);
499
+ uint32_t session_id;
500
+ parsers::to_number (line, session_id);
501
+ return session_id;
502
+ }
503
+
492
504
} // namespace pfs
You can’t perform that action at this time.
0 commit comments