<refname>sd_session_is_remote</refname>
<refname>sd_session_get_state</refname>
<refname>sd_session_get_uid</refname>
+ <refname>sd_session_get_username</refname>
<refname>sd_session_get_seat</refname>
<refname>sd_session_get_service</refname>
<refname>sd_session_get_type</refname>
<paramdef>uid_t *<parameter>uid</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>int <function>sd_session_get_username</function></funcdef>
+ <paramdef>const char *<parameter>session</parameter></paramdef>
+ <paramdef>char **<parameter>username</parameter></paramdef>
+ </funcprototype>
+
<funcprototype>
<funcdef>int <function>sd_session_get_seat</function></funcdef>
<paramdef>const char *<parameter>session</parameter></paramdef>
determine the user identifier of the Unix user the session
identified by the specified session identifier belongs to.</para>
+ <para><function>sd_session_get_username()</function> may be used to
+ determine the name of the Unix user the session identified by
+ the specified session identifier belongs to. The returned string
+ needs to be freed with the libc
+ <citerefentry project='man-pages'><refentrytitle>free</refentrytitle><manvolnum>3</manvolnum></citerefentry>
+ call after use.</para>
+
<para><function>sd_session_get_seat()</function> may be used to
determine the seat identifier of the seat the session identified
by the specified session identifier belongs to. Note that not all
positive integer; if it fails, 0. On success,
<function>sd_session_get_state()</function>,
<function>sd_session_get_uid()</function>,
+ <function>sd_session_get_username()</function>,
<function>sd_session_get_seat()</function>,
<function>sd_session_get_service()</function>,
<function>sd_session_get_type()</function>,
return 0;
}
+_public_ int sd_session_get_username(const char *session, char **username) {
+ return session_get_string(session, "USER", username);
+}
+
_public_ int sd_session_get_seat(const char *session, char **seat) {
return session_get_string(session, "SEAT", seat);
}
/* 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);