chiark / gitweb /
Classify processes from sessions into cgroups
[elogind.git] / src / libelogind / sd-login / sd-login.c
index f4dd7feecb3627b5e54076118b1af979f88beaf9..4f625ea335e9874ca322c9d96256398d5649b87e 100644 (file)
@@ -58,7 +58,12 @@ _public_ int sd_pid_get_unit(pid_t pid, char **unit) {
         assert_return(pid >= 0, -EINVAL);
         assert_return(unit, -EINVAL);
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_unit(pid, unit);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_pid_get_user_unit(pid_t pid, char **unit) {
@@ -66,7 +71,12 @@ _public_ int sd_pid_get_user_unit(pid_t pid, char **unit) {
         assert_return(pid >= 0, -EINVAL);
         assert_return(unit, -EINVAL);
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_user_unit(pid, unit);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_pid_get_machine_name(pid_t pid, char **name) {
@@ -74,7 +84,12 @@ _public_ int sd_pid_get_machine_name(pid_t pid, char **name) {
         assert_return(pid >= 0, -EINVAL);
         assert_return(name, -EINVAL);
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_machine_name(pid, name);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_pid_get_slice(pid_t pid, char **slice) {
@@ -82,7 +97,12 @@ _public_ int sd_pid_get_slice(pid_t pid, char **slice) {
         assert_return(pid >= 0, -EINVAL);
         assert_return(slice, -EINVAL);
 
+/// elogind does not support systemd slices
+#if 0
         return cg_pid_get_slice(pid, slice);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_pid_get_user_slice(pid_t pid, char **slice) {
@@ -90,7 +110,12 @@ _public_ int sd_pid_get_user_slice(pid_t pid, char **slice) {
         assert_return(pid >= 0, -EINVAL);
         assert_return(slice, -EINVAL);
 
+/// elogind does not support systemd slices
+#if 0
         return cg_pid_get_user_slice(pid, slice);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_pid_get_owner_uid(pid_t pid, uid_t *uid) {
@@ -98,7 +123,12 @@ _public_ int sd_pid_get_owner_uid(pid_t pid, uid_t *uid) {
         assert_return(pid >= 0, -EINVAL);
         assert_return(uid, -EINVAL);
 
+/// elogind does not support systemd slices
+#if 0
         return cg_pid_get_owner_uid(pid, uid);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_pid_get_cgroup(pid_t pid, char **cgroup) {
@@ -138,7 +168,12 @@ _public_ int sd_peer_get_session(int fd, char **session) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd scopes
+#if 0
         return cg_pid_get_session(ucred.pid, session);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_owner_uid(int fd, uid_t *uid) {
@@ -152,7 +187,12 @@ _public_ int sd_peer_get_owner_uid(int fd, uid_t *uid) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_owner_uid(ucred.pid, uid);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_unit(int fd, char **unit) {
@@ -166,7 +206,12 @@ _public_ int sd_peer_get_unit(int fd, char **unit) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_unit(ucred.pid, unit);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_user_unit(int fd, char **unit) {
@@ -180,7 +225,12 @@ _public_ int sd_peer_get_user_unit(int fd, char **unit) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_user_unit(ucred.pid, unit);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_machine_name(int fd, char **machine) {
@@ -194,7 +244,12 @@ _public_ int sd_peer_get_machine_name(int fd, char **machine) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd units
+#if 0
         return cg_pid_get_machine_name(ucred.pid, machine);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_slice(int fd, char **slice) {
@@ -208,7 +263,12 @@ _public_ int sd_peer_get_slice(int fd, char **slice) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd slices
+#if 0
         return cg_pid_get_slice(ucred.pid, slice);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_user_slice(int fd, char **slice) {
@@ -222,7 +282,12 @@ _public_ int sd_peer_get_user_slice(int fd, char **slice) {
         if (r < 0)
                 return r;
 
+/// elogind does not support systemd slices
+#if 0
         return cg_pid_get_user_slice(ucred.pid, slice);
+#else
+        return -ESRCH;
+#endif // 0
 }
 
 _public_ int sd_peer_get_cgroup(int fd, char **cgroup) {