Hide GDBus from RTKit API
Remove register node from dbus API
Add signal
Add object and register objects in the registry
Add some preregistered types to the registry
Let the daemon listen to the registry
This commit is contained in:
Wim Taymans 2016-11-08 18:00:52 +01:00
parent e88a376d7c
commit 89bc235924
27 changed files with 568 additions and 462 deletions

View file

@ -20,49 +20,59 @@
#ifndef __PINOS_RTKIT_H__
#define __PINOS_RTKIT_H__
#include <gio/gio.h>
#include <glib-object.h>
#include <sys/types.h>
#include <unistd.h>
G_BEGIN_DECLS
#ifdef __cplusplus
extern "C" {
#endif
#define RTKIT_SERVICE_NAME "org.freedesktop.RealtimeKit1"
#define RTKIT_OBJECT_PATH "/org/freedesktop/RealtimeKit1"
typedef struct _PinosRTKitBus PinosRTKitBus;
PinosRTKitBus * pinos_rtkit_bus_get_system (void);
void pinos_rtkit_bus_free (PinosRTKitBus *system_bus);
/* This is mostly equivalent to sched_setparam(thread, SCHED_RR, {
* .sched_priority = priority }). 'thread' needs to be a kernel thread
* id as returned by gettid(), not a pthread_t! If 'thread' is 0 the
* current thread is used.
*/
gboolean pinos_rtkit_make_realtime (GDBusConnection *system_bus,
pid_t thread,
gint priority,
GError **error);
* current thread is used. The returned value is a negative errno
* style error code, or 0 on success. */
int pinos_rtkit_make_realtime (PinosRTKitBus *system_bus,
pid_t thread,
int priority);
/* This is mostly equivalent to setpriority(PRIO_PROCESS, thread,
* nice_level). 'thread' needs to be a kernel thread id as returned by
* gettid(), not a pthread_t! If 'thread' is 0 the current thread is
* used. */
gboolean pinos_rtkit_make_high_priority (GDBusConnection *system_bus,
pid_t thread,
gint nice_level,
GError **error);
* used. The returned value is a negative errno style error code, or
* 0 on success. */
int pinos_rtkit_make_high_priority (PinosRTKitBus *system_bus,
pid_t thread,
int nice_level);
/* Return the maximum value of realtime priority available. Realtime requests
* above this value will fail. A negative value is an errno style error code.
*/
int pinos_rtkit_get_max_realtime_priority (GDBusConnection *system_bus);
int pinos_rtkit_get_max_realtime_priority (PinosRTKitBus *system_bus);
/* Retreive the minimum value of nice level available. High prio requests
* below this value will fail. The returned value is a negative errno
* style error code, or 0 on success.*/
int pinos_rtkit_get_min_nice_level (GDBusConnection *system_bus, int* min_nice_level);
int pinos_rtkit_get_min_nice_level (PinosRTKitBus *system_bus,
int *min_nice_level);
/* Return the maximum value of RLIMIT_RTTIME to set before attempting a
* realtime request. A negative value is an errno style error code.
*/
long long rtkit_get_rttime_usec_max (GDBusConnection *system_bus);
long long pinos_rtkit_get_rttime_usec_max (PinosRTKitBus *system_bus);
G_END_DECLS
#ifdef __cplusplus
}
#endif
#endif /* __PINOS_RTKIT_H__ */