summaryrefslogtreecommitdiff
path: root/src/systemd/sd-login.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-04 09:54:14 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-05 14:56:23 +0200
commitf5aaf575626022313b07d505699fa1af25d248ac (patch)
tree72f56593684aff2f66c67f079886f6de3ac30372 /src/systemd/sd-login.h
parent19af675e99d32172b58f1c91c8281ba2efd5d863 (diff)
downloadsystemd-f5aaf575626022313b07d505699fa1af25d248ac.tar.gz
sd-login: add new sd_pid_get_cgroup() API
This adds a new sd_pid_get_cgroup() call to sd-login which may be used to query the control path of a process. This is useful for programs when making use of delegation units, in order to figure out which subtree has been delegated. In light of the unified control group hierarchy this is finally safe to do, hence let's add a proper API for it, to make it easier to use this.
Diffstat (limited to 'src/systemd/sd-login.h')
-rw-r--r--src/systemd/sd-login.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h
index 9260396d5d..39b68c3895 100644
--- a/src/systemd/sd-login.h
+++ b/src/systemd/sd-login.h
@@ -81,6 +81,10 @@ int sd_pid_get_user_slice(pid_t pid, char **slice);
* container. This will return an error for non-machine processes. */
int sd_pid_get_machine_name(pid_t pid, char **machine);
+/* Get the control group from a PID, relative to the root of the
+ * hierarchy. */
+int sd_pid_get_cgroup(pid_t pid, char **cgroup);
+
/* Similar to sd_pid_get_session(), but retrieves data about peer of
* connected AF_UNIX socket */
int sd_peer_get_session(int fd, char **session);
@@ -109,6 +113,10 @@ int sd_peer_get_user_slice(int fd, char **slice);
* of connected AF_UNIX socket */
int sd_peer_get_machine_name(int fd, char **machine);
+/* Similar to sd_pid_get_cgroup(), but retrieves data about the peer
+ * of a connected AF_UNIX socket. */
+int sd_peer_get_cgroup(pid_t pid, char **cgroup);
+
/* Get state from UID. Possible states: offline, lingering, online, active, closing */
int sd_uid_get_state(uid_t uid, char **state);