X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=man%2Fsd_uid_get_state.xml;h=2a91686e1c7e9a04c8bce09d33dce23cea4239a3;hb=eea10b26f78806d7b244af7d37f75fd567c69610;hp=02670e1bce971176b1ca112d88ebcb7b1d9ea3bb;hpb=5e3fc5730c08a473856a283675474ec2101dd726;p=thirdparty%2Fsystemd.git diff --git a/man/sd_uid_get_state.xml b/man/sd_uid_get_state.xml index 02670e1bce9..2a91686e1c7 100644 --- a/man/sd_uid_get_state.xml +++ b/man/sd_uid_get_state.xml @@ -1,10 +1,7 @@ - - - + + @@ -25,6 +22,7 @@ sd_uid_get_sessions sd_uid_get_seats sd_uid_get_display + sd_uid_get_login_time Determine login state of a specific Unix user ID @@ -64,6 +62,12 @@ uid_t uid char **session + + + int sd_uid_get_login_time + uid_t uid + uint64_t *usec + @@ -104,7 +108,7 @@ require_active parameter controls whether the returned list shall consist of only those sessions where the user is currently active (> 0), where the user is currently - online but possibly inactive (= 0), or logged in at all but + online but possibly inactive (= 0), or logged in but possibly closing the session (< 0). The call returns a NULL terminated string array of session identifiers in sessions which needs to be @@ -129,72 +133,83 @@ of the "primary" session of a user. If the user has graphical sessions, it will be the oldest graphical session. Otherwise, it will be the oldest open session. + + sd_uid_get_login_time() may be used to + determine the time the user's service manager has been invoked, + which is the time when the user's first active session, since which + they stayed logged in continuously, began. The usec + is in microseconds since the epoch (CLOCK_REALTIME). + This call will fail with -ENXIO if the user is not + currently logged in. Return Value - On success, sd_uid_get_state() returns - 0 or a positive integer. If the test succeeds, - sd_uid_is_on_seat() returns a positive - integer; if it fails, 0. - sd_uid_get_sessions() and - sd_uid_get_seats() return the number of - entries in the returned arrays. - sd_uid_get_display() returns a non-negative - code on success. On failure, these calls return a negative - errno-style error code. - + On success, sd_uid_get_state() and + sd_uid_get_login_time() returns 0 or a positive + integer. If the test succeeds, sd_uid_is_on_seat() + returns a positive integer; if it fails, 0. sd_uid_get_sessions() + and sd_uid_get_seats() return the number of entries + in the returned arrays. sd_uid_get_display() + returns a non-negative code on success. On failure, these calls return + a negative errno-style error code. - - Errors + + Errors - Returned errors may indicate the following problems: + Returned errors may indicate the following problems: - + - - -ENODATA + + -ENODATA - The given field is not specified for the described - user. - - + The given field is not specified for the described user. + + - - -ENXIO + + -ENXIO - The specified seat is unknown. - - + The specified seat is unknown. + + - - -EINVAL + + -EINVAL - An input parameter was invalid (out of range, - or NULL, where that is not accepted). This is also returned if - the passed user ID is 0xFFFF or 0xFFFFFFFF, which are - undefined on Linux. - + An input parameter was invalid (out of range, or NULL, + where that is not accepted). This is also returned if the passed user ID is + 0xFFFF or 0xFFFFFFFF, which are undefined on Linux. + + - - -ENOMEM + + -ENOMEM - Memory allocation failed. - - + Memory allocation failed. + + + + + History + sd_uid_get_display() was added in version 213. + sd_uid_get_login_time() was added in version 254. + + See Also - - systemd1, - sd-login3, - sd_pid_get_owner_uid3 - + + systemd1 + sd-login3 + sd_pid_get_owner_uid3 +