mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-07 08:07:20 +02:00
daemon: getters for properties of GameModeClient
Add getters for all two properties of GameModeCLient: the process id and the executable path.
This commit is contained in:
parent
d99af40795
commit
455ea0c72e
@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include "build-config.h"
|
#include "build-config.h"
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
@ -646,6 +647,24 @@ void game_mode_client_ref(GameModeClient *client)
|
|||||||
atomic_fetch_add_explicit(&client->refcount, 1, memory_order_seq_cst);
|
atomic_fetch_add_explicit(&client->refcount, 1, memory_order_seq_cst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The process identifier of the client.
|
||||||
|
*/
|
||||||
|
pid_t game_mode_client_get_pid(GameModeClient *client)
|
||||||
|
{
|
||||||
|
assert(client != NULL);
|
||||||
|
return client->pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path to the executable of client.
|
||||||
|
*/
|
||||||
|
const char *game_mode_client_get_executable(GameModeClient *client)
|
||||||
|
{
|
||||||
|
assert(client != NULL);
|
||||||
|
return client->executable;
|
||||||
|
}
|
||||||
|
|
||||||
/* Internal refresh config function (assumes no contention with reaper thread) */
|
/* Internal refresh config function (assumes no contention with reaper thread) */
|
||||||
static void game_mode_reload_config_internal(GameModeContext *self)
|
static void game_mode_reload_config_internal(GameModeContext *self)
|
||||||
{
|
{
|
||||||
|
@ -59,6 +59,16 @@ void game_mode_client_unref(GameModeClient *client);
|
|||||||
*/
|
*/
|
||||||
void game_mode_client_ref(GameModeClient *client);
|
void game_mode_client_ref(GameModeClient *client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The process identifier of the client.
|
||||||
|
*/
|
||||||
|
pid_t game_mode_client_get_pid(GameModeClient *client);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The path to the executable of client.
|
||||||
|
*/
|
||||||
|
const char *game_mode_client_get_executable(GameModeClient *client);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the singleton instance
|
* Return the singleton instance
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user