summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-kernel.c
diff options
context:
space:
mode:
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;
+}