diff options
author | Evgeny Vereshchagin <evvers@ya.ru> | 2015-10-15 11:55:04 +0000 |
---|---|---|
committer | Evgeny Vereshchagin <evvers@ya.ru> | 2015-10-15 12:02:43 +0000 |
commit | eed67a3041d1d9a03a2931bac7512eb35b74a422 (patch) | |
tree | 3d20c60b911358124377c1aafaba6bb8d491c27b /src/core | |
parent | e18992ad4f21d300b6dc46d706227819fd3c5d6a (diff) |
core: expose manager's TimerSlackNSec as propery on dbus
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/dbus-manager.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index 9ddc65d10b..00bb391106 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -20,6 +20,7 @@ ***/ #include <errno.h> +#include <sys/prctl.h> #include <unistd.h> #include "log.h" @@ -346,6 +347,21 @@ static int property_set_runtime_watchdog( return watchdog_set_timeout(t); } +static int property_get_timer_slack_nsec( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *error) { + + assert(bus); + assert(reply); + + return sd_bus_message_append(reply, "t", (uint64_t) prctl(PR_GET_TIMERSLACK)); +} + static int method_get_unit(sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *path = NULL; Manager *m = userdata; @@ -1993,6 +2009,7 @@ const sd_bus_vtable bus_manager_vtable[] = { SD_BUS_PROPERTY("DefaultLimitNICE", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_NICE]), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("DefaultLimitRTPRIO", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RTPRIO]), SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_PROPERTY("DefaultLimitRTTIME", "t", bus_property_get_rlimit, offsetof(Manager, rlimit[RLIMIT_RTTIME]), SD_BUS_VTABLE_PROPERTY_CONST), + SD_BUS_PROPERTY("TimerSlackNSec", "t", property_get_timer_slack_nsec, 0, SD_BUS_VTABLE_PROPERTY_CONST), SD_BUS_METHOD("GetUnit", "s", "o", method_get_unit, SD_BUS_VTABLE_UNPRIVILEGED), SD_BUS_METHOD("GetUnitByPID", "u", "o", method_get_unit_by_pid, SD_BUS_VTABLE_UNPRIVILEGED), |