summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-15 14:16:45 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-15 14:16:45 +0200
commit97e13058170c7759dbbc239d264b9a31b0c81079 (patch)
treeda7a8337cb4193037572b5331844110251b21aa8 /src/login
parent6c03089c32c251d823173bda4d809a9e643219f0 (diff)
sd-login: add a sd_pid_get_user_unit() call
Diffstat (limited to 'src/login')
-rw-r--r--src/login/libsystemd-login.sym5
-rw-r--r--src/login/sd-login.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/src/login/libsystemd-login.sym b/src/login/libsystemd-login.sym
index ce2304a1ba..9048de86a9 100644
--- a/src/login/libsystemd-login.sym
+++ b/src/login/libsystemd-login.sym
@@ -64,3 +64,8 @@ global:
sd_login_monitor_get_events;
sd_login_monitor_get_timeout;
} LIBSYSTEMD_LOGIN_198;
+
+LIBSYSTEMD_LOGIN_202 {
+global:
+ sd_pid_get_user_unit;
+} LIBSYSTEMD_LOGIN_201;
diff --git a/src/login/sd-login.c b/src/login/sd-login.c
index f433e3e80b..4c918f2105 100644
--- a/src/login/sd-login.c
+++ b/src/login/sd-login.c
@@ -84,6 +84,17 @@ _public_ int sd_pid_get_unit(pid_t pid, char **unit) {
return cg_pid_get_unit(pid, unit);
}
+_public_ int sd_pid_get_user_unit(pid_t pid, char **unit) {
+
+ if (pid < 0)
+ return -EINVAL;
+
+ if (!unit)
+ return -EINVAL;
+
+ return cg_pid_get_user_unit(pid, unit);
+}
+
_public_ int sd_pid_get_owner_uid(pid_t pid, uid_t *uid) {
int r;
char *root, *cgroup, *p, *cc;