]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/systemd/sd-login.h
Merge pull request #26574 from YHNdnzj/sd-login-new-interface
[thirdparty/systemd.git] / src / systemd / sd-login.h
index 54970532eca8a63394090763176bbeec9cc0ce3c..526af34d376dc2b2db377edb5f7bc6ef0d407bf4 100644 (file)
@@ -80,6 +80,18 @@ int sd_pid_get_machine_name(pid_t pid, char **machine);
  * hierarchy. */
 int sd_pid_get_cgroup(pid_t pid, char **cgroup);
 
+/* Equivalent to the corresponding sd_pid_get* functions, but take a
+ * PIDFD instead of a PID, to ensure there can be no possible PID
+ * recycle issues before/after the calls. */
+int sd_pidfd_get_session(pid_t pid, char **session);
+int sd_pidfd_get_owner_uid(pid_t pid, uid_t *uid);
+int sd_pidfd_get_unit(pid_t pid, char **unit);
+int sd_pidfd_get_user_unit(pid_t pid, char **unit);
+int sd_pidfd_get_slice(pid_t pid, char **slice);
+int sd_pidfd_get_user_slice(pid_t pid, char **slice);
+int sd_pidfd_get_machine_name(pid_t pid, char **machine);
+int sd_pidfd_get_cgroup(pid_t pid, char **cgroup);
+
 /* Similar to sd_pid_get_session(), but retrieves data about the peer
  * of a connected AF_UNIX socket */
 int sd_peer_get_session(int fd, char **session);
@@ -145,9 +157,15 @@ int sd_session_get_state(const char *session, char **state);
 /* Determine user ID of session */
 int sd_session_get_uid(const char *session, uid_t *uid);
 
+/* Determine username of session */
+int sd_session_get_username(const char *session, char **username);
+
 /* Determine seat of session */
 int sd_session_get_seat(const char *session, char **seat);
 
+/* Determine the start time of session */
+int sd_session_get_start_time(const char *session, uint64_t *usec);
+
 /* Determine the (PAM) service name this session was registered by. */
 int sd_session_get_service(const char *session, char **service);