cgroup-util: introduce cg_get_cgroupid_at()
Suggested in https://github.com/systemd/systemd/pull/35242#discussion_r1862658163
This commit is contained in:
@@ -183,6 +183,14 @@ typedef enum CGroupUnified {
|
||||
int cg_path_open(const char *controller, const char *path);
|
||||
int cg_cgroupid_open(int fsfd, uint64_t id);
|
||||
|
||||
int cg_get_cgroupid_at(int dfd, const char *path, uint64_t *ret);
|
||||
static inline int cg_path_get_cgroupid(const char *path, uint64_t *ret) {
|
||||
return cg_get_cgroupid_at(AT_FDCWD, path, ret);
|
||||
}
|
||||
static inline int cg_fd_get_cgroupid(int fd, uint64_t *ret) {
|
||||
return cg_get_cgroupid_at(fd, NULL, ret);
|
||||
}
|
||||
|
||||
typedef enum CGroupFlags {
|
||||
CGROUP_SIGCONT = 1 << 0,
|
||||
CGROUP_IGNORE_SELF = 1 << 1,
|
||||
@@ -265,8 +273,6 @@ int cg_is_empty_recursive(const char *controller, const char *path);
|
||||
|
||||
int cg_get_root_path(char **path);
|
||||
|
||||
int cg_path_get_cgroupid(const char *path, uint64_t *ret);
|
||||
int cg_fd_get_cgroupid(int fd, uint64_t *ret);
|
||||
int cg_path_get_session(const char *path, char **ret_session);
|
||||
int cg_path_get_owner_uid(const char *path, uid_t *ret_uid);
|
||||
int cg_path_get_unit(const char *path, char **ret_unit);
|
||||
|
||||
Reference in New Issue
Block a user