chiark / gitweb /
bus: unref buscreds on failure
[elogind.git] / src / libsystemd / sd-bus / PORTING-DBUS1
index 0253a42137850b113aee41ad5c2a4e1d373c726d..9f0a91d6954a3975d61bd3f74274b56b82215fb9 100644 (file)
@@ -123,8 +123,8 @@ at the same time!
 This pretty much explains the ioctl header. The actual payload of the
 data is now referenced in additional items that are attached to this
 ioctl header structure at the end. When sending a message, you attach
-items of the type PAYLOAD_VEC, PAYLOAD_MEMFD, FDS, BLOOM, DST_NAME to
-it:
+items of the type PAYLOAD_VEC, PAYLOAD_MEMFD, FDS, BLOOM_FILTER,
+DST_NAME to it:
 
    KDBUS_ITEM_PAYLOAD_VEC: contains a pointer + length pair for
    referencing arbitrary user memory. This is how you reference most
@@ -134,15 +134,15 @@ it:
    to send prepared "memfds" (see below) over. This item contains an
    fd for a memfd plus a size.
 
-   KDBUS_ITEM_PAYLOAD_FDS: for sending over fds attach an item of this
-   type with an array of fds.
+   KDBUS_ITEM_FDS: for sending over fds attach an item of this type with
+   an array of fds.
 
-   KDBUS_ITEM_BLOOM: the calculated bloom filter of this message, only
-   for undirected (broadcast) message.
+   KDBUS_ITEM_BLOOM_FILTER: the calculated bloom filter of this message,
+   only for undirected (broadcast) message.
 
-   KDBUS_DST_NAME: for messages that are directed to a well-known name
-   (instead of a unique name), this item contains the well-known name
-   field.
+   KDBUS_ITEM_DST_NAME: for messages that are directed to a well-known
+   name (instead of a unique name), this item contains the well-known
+   name field.
 
 A single message may consists of no, one or more payload items of type
 PAYLOAD_VEC or PAYLOAD_MEMFD. D-Bus protocol implementations should
@@ -342,7 +342,7 @@ items of the same type as the kernel messages include,
 i.e. KDBUS_ITEM_NAME_ADD, KDBUS_ITEM_NAME_REMOVE,
 KDBUS_ITEM_NAME_CHANGE, KDBUS_ITEM_ID_ADD, KDBUS_ITEM_ID_REMOVE and
 fill them out. Note however, that you have some wildcards in this
-case, for example the .id field of KDBUS_ITEM_ADD/KDBUS_ITEM_REMOVE
+case, for example the .id field of KDBUS_ITEM_ID_ADD/KDBUS_ITEM_ID_REMOVE
 structures may be set to 0 to match against any id addition/removal.
 
 Note that dbus match strings do no map 1:1 to these ioctl() calls. In
@@ -362,46 +362,6 @@ ioctl()s are added for a single match strings.
 
 MEMFDS
 
-The "memfd" concept is used for zero-copy data transfers (see
-above). memfds are file descriptors to memory chunks of arbitrary
-sizes. If you have a memfd you can mmap() it to get access to the data
-it contains or write to it. They are comparable to file descriptors to
-unlinked files on a tmpfs, or to anonymous memory that one may refer
-to with an fd. They have one particular property: they can be
-"sealed". A memfd that is "sealed" is protected from alteration. Only
-memfds that are currently not mapped and to which a single fd refers
-may be sealed (they may also be unsealed in that case).
-
-The concept of "sealing" makes memfds useful for using them as
-transport for kdbus messages: only when the receiver knows that the
-message it has received cannot change while looking at, it can safely
-parse it without having to copy it to a safe memory area. memfds can also
-be reused in multiple messages. A sender may send the same memfd to
-multiple peers, and since it is sealed, it can be sure that the receiver
-will not be able to modify it. "Sealing" hence provides both sides of
-a transaction with the guarantee that the data stays constant and is
-reusable.
-
-memfds are a generic concept that can be used outside of the immediate
-kdbus usecase. You can send them across AF_UNIX sockets too, sealed or
-unsealed. In kdbus themselves, they can be used to send zero-copy
-payloads, but may also be sent as normal fds.
-
-memfds are allocated with the KDBUS_CMD_MEMFD_NEW ioctl. After allocation,
-simply memory map them and write to them. To set their size, use
-KDBUS_CMD_MEMFD_SIZE_SET. Note that memfds will be increased in size
-automatically if you touch previously unallocated pages. However, the
-size will only be increased in multiples of the page size in that
-case. Thus, in almost all cases, an explicit KDBUS_CMD_MEMFD_SIZE_SET
-is necessary, since it allows setting memfd sizes in finer
-granularity. To seal a memfd use the KDBUS_CMD_MEMFD_SEAL_SET ioctl
-call. It will only succeed if the caller has the only fd reference to
-the memfd open, and if the memfd is currently unmapped.
-
-If memfds are shared, keep in mind that the file pointer used by
-write/read/seek is shared too, only pread/pwrite are safe to use
-in that case.
-
 memfds may be sent across kdbus via KDBUS_ITEM_PAYLOAD_MEMFD items
 attached to messages. If this is done, the data included in the memfd
 is considered part of the payload stream of a message, and are treated