diff --git a/daemon/gamemode-context.c b/daemon/gamemode-context.c index 6e23116..e0351d6 100644 --- a/daemon/gamemode-context.c +++ b/daemon/gamemode-context.c @@ -46,6 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include #include /* TODO: Move usage to gamemode-dbus.c */ #include @@ -58,6 +59,7 @@ struct GameModeClient { pid_t pid; /**< Process ID */ struct GameModeClient *next; /**refcount = ATOMIC_VAR_INIT(1); strncpy(ret->executable, executable, PATH_MAX - 1); + return ret; } @@ -714,6 +726,15 @@ const char *game_mode_client_get_executable(GameModeClient *client) return client->executable; } +/** + * The time that game mode was requested for the client. + */ +uint64_t game_mode_client_get_timestamp(GameModeClient *client) +{ + assert(client != NULL); + return (uint64_t)client->timestamp; +} + /* Internal refresh config function (assumes no contention with reaper thread) */ static void game_mode_reload_config_internal(GameModeContext *self) { diff --git a/daemon/gamemode.h b/daemon/gamemode.h index 27151fa..78418f0 100644 --- a/daemon/gamemode.h +++ b/daemon/gamemode.h @@ -32,6 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #pragma once #include +#include #include #define INVALID_PROCFD -1 @@ -69,6 +70,11 @@ pid_t game_mode_client_get_pid(GameModeClient *client); */ const char *game_mode_client_get_executable(GameModeClient *client); +/** + * The time that game mode was requested for the client. + */ +u_int64_t game_mode_client_get_timestamp(GameModeClient *client); + /** * Return the singleton instance */