summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLukasz Skalski <l.skalski@partner.samsung.com>2013-12-03 15:17:55 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-10 20:32:20 +0000
commitc8fa3f60302f6d1bf7b2f7b31fb7e5a46b3d53c1 (patch)
tree8606fbdc755fb65ae40338990f3e3c80cfa4a4b6 /src/libsystemd-bus/bus-kernel.c
parent65a6df56f136ed3977f7fcd688f62a25371506fa (diff)
bus: Add bus_kernel_monitor function
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd-bus/bus-kernel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index d0a9fbc3fb..e2e825f0f3 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -1211,3 +1211,19 @@ int bus_kernel_create_namespace(const char *name, char **s) {
return fd;
}
+
+int bus_kernel_monitor(sd_bus *bus) {
+ struct kdbus_cmd_monitor cmd_monitor;
+ int r;
+
+ assert(bus);
+
+ cmd_monitor.id = 0;
+ cmd_monitor.flags = KDBUS_MONITOR_ENABLE;
+
+ r = ioctl(bus->input_fd, KDBUS_CMD_MONITOR, &cmd_monitor);
+ if (r < 0)
+ return -errno;
+
+ return 1;
+}