kdbus.h: add KDBUS_ITEM_CANCEL_FD (ABI break)
authorDaniel Mack <daniel@zonque.org>
Fri, 19 Dec 2014 18:11:29 +0000 (19:11 +0100)
committerDaniel Mack <daniel@zonque.org>
Fri, 19 Dec 2014 18:28:36 +0000 (19:28 +0100)
Add a new item that takes a file descriptor, used to cancel a synchronous
SEND operation.

Signed-off-by: Daniel Mack <daniel@zonque.org>
item.c
kdbus.h

diff --git a/item.c b/item.c
index d813823c86edbcddd2985663bd8e5b82f1f11475..fdc8c6729c9d2e5f75002d57e297c996c160a9dd 100644 (file)
--- a/item.c
+++ b/item.c
@@ -88,6 +88,11 @@ static int kdbus_item_validate(const struct kdbus_item *item)
                        return -EINVAL;
                break;
 
+       case KDBUS_ITEM_CANCEL_FD:
+               if (payload_size != sizeof(int))
+                       return -EINVAL;
+               break;
+
        case KDBUS_ITEM_BLOOM_PARAMETER:
                if (payload_size != sizeof(struct kdbus_bloom_parameter))
                        return -EINVAL;
diff --git a/kdbus.h b/kdbus.h
index 4119969b442ec37cb3d9849ca7007cf683d6435f..d124f21a36000d701d62bc4086a7a2625a312802 100644 (file)
--- a/kdbus.h
+++ b/kdbus.h
@@ -229,6 +229,9 @@ struct kdbus_policy_access {
  * @KDBUS_ITEM_PAYLOAD_OFF:            Data at returned offset to message head
  * @KDBUS_ITEM_PAYLOAD_MEMFD:          Data as sealed memfd
  * @KDBUS_ITEM_FDS:                    Attached file descriptors
+ * @KDBUS_ITEM_CANCEL_FD:              FD used to cancel a synchronous
+ *                                     operation by writing to it from
+ *                                     userspace
  * @KDBUS_ITEM_BLOOM_PARAMETER:                Bus-wide bloom parameters, used with
  *                                     KDBUS_CMD_BUS_MAKE, carries a
  *                                     struct kdbus_bloom_parameter
@@ -292,6 +295,7 @@ enum kdbus_item_type {
        KDBUS_ITEM_PAYLOAD_OFF,
        KDBUS_ITEM_PAYLOAD_MEMFD,
        KDBUS_ITEM_FDS,
+       KDBUS_ITEM_CANCEL_FD,
        KDBUS_ITEM_BLOOM_PARAMETER,
        KDBUS_ITEM_BLOOM_FILTER,
        KDBUS_ITEM_BLOOM_MASK,