summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-kernel.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-22 20:26:58 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-22 20:26:58 +0100
commit766c580959336be16f7c724b158f8e8fbaba2e9a (patch)
tree3e31e4139a7172837953bcfdaf8c437f16350c77 /src/libsystemd/sd-bus/bus-kernel.c
parentca7b42c81652c342288a3e0a10abd885c66ac5b2 (diff)
bus: add sd_bus_process_priority() to support prioq mode of kdbus
Diffstat (limited to 'src/libsystemd/sd-bus/bus-kernel.c')
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 77ad5ca506..27c2e0efcf 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -1039,7 +1039,7 @@ static int bus_kernel_translate_message(sd_bus *bus, struct kdbus_msg *k) {
return translate[found->type - _KDBUS_ITEM_KERNEL_BASE](bus, k, found);
}
-int bus_kernel_read_message(sd_bus *bus) {
+int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority) {
struct kdbus_cmd_recv recv = {};
struct kdbus_msg *k;
int r;
@@ -1050,6 +1050,11 @@ int bus_kernel_read_message(sd_bus *bus) {
if (r < 0)
return r;
+ if (hint_priority) {
+ recv.flags |= KDBUS_RECV_USE_PRIORITY;
+ recv.priority = priority;
+ }
+
r = ioctl(bus->input_fd, KDBUS_CMD_MSG_RECV, &recv);
if (r < 0) {
if (errno == EAGAIN)