* struct kdbus_cmd_name - struct to describe a well-known name
* @size: The total size of the struct
* @flags: Flags for a name entry (KDBUS_NAME_*)
- * @owner_id: The current owner of the name
- * @conn_flags: The flags of the owning connection (KDBUS_HELLO_*)
* @items: Item list, containing the well-known name as
* KDBUS_ITEM_NAME
*
struct kdbus_cmd_name {
__u64 size;
__u64 flags;
- __u64 owner_id;
+ struct kdbus_item items[0];
+} __attribute__((aligned(8)));
+
+/**
+ * struct kdbus_name_info - struct to describe a well-known name
+ * @size: The total size of the struct
+ * @flags: Flags for a name entry (KDBUS_NAME_*),
+ * @conn_flags: The flags of the owning connection (KDBUS_HELLO_*)
+ * @owner_id: The current owner of the name
+ * @items: Item list, containing the well-known name as
+ * KDBUS_ITEM_NAME
+ *
+ * This structure is used as return struct for the KDBUS_CMD_NAME_LIST ioctl.
+ */
+struct kdbus_name_info {
+ __u64 size;
+ __u64 flags;
__u64 conn_flags;
+ __u64 owner_id;
struct kdbus_item items[0];
} __attribute__((aligned(8)));
*/
struct kdbus_name_list {
__u64 size;
- struct kdbus_cmd_name names[0];
+ struct kdbus_name_info names[0];
};
/**
struct kdbus_name_entry *e,
bool write)
{
- const size_t len = sizeof(struct kdbus_cmd_name);
+ const size_t len = sizeof(struct kdbus_name_info);
size_t p = *pos;
size_t nlen = 0;
if (write) {
int ret;
- struct kdbus_cmd_name n = {
+ struct kdbus_name_info info = {
.size = len,
.owner_id = c->id,
.flags = e ? e->flags : 0,
};
if (nlen)
- n.size += KDBUS_ITEM_SIZE(nlen);
+ info.size += KDBUS_ITEM_SIZE(nlen);
/* write record */
- ret = kdbus_pool_slice_copy(slice, p, &n, len);
+ ret = kdbus_pool_slice_copy(slice, p, &info, len);
if (ret < 0)
return ret;
p += len;
{
struct kdbus_cmd_name_list cmd_list;
struct kdbus_name_list *list;
- struct kdbus_cmd_name *name;
+ struct kdbus_name_info *name;
int ret;
cmd_list.flags = flags;
{
struct kdbus_cmd_name_list cmd_list;
struct kdbus_name_list *list;
- struct kdbus_cmd_name *name;
+ struct kdbus_name_info *name;
bool found = false;
int ret;