struct kdbus_name_list *name_list;
struct kdbus_cmd_name *name;
- cmd = malloc0(sizeof(struct kdbus_cmd_name_list *));
+ cmd = malloc0(sizeof(struct kdbus_cmd_name_list));
if (!cmd)
return -ENOMEM;
+ cmd->size = sizeof(struct kdbus_cmd_name_list);
cmd->flags = KDBUS_NAME_LIST_UNIQUE | KDBUS_NAME_LIST_NAMES;
r = ioctl(sd_bus_get_fd(bus), KDBUS_CMD_NAME_LIST, cmd);
/**
* struct kdbus_cmd_name_list - request a list of name entries
+ * @size Total size of the struct
* @flags: Flags for the query (KDBUS_NAME_LIST_*)
* @offset: The returned offset in the caller's pool buffer.
* The user must use KDBUS_CMD_FREE to free the
* Refer to the documentation for more information.
*/
struct kdbus_cmd_name_list {
+ __u64 size;
__u64 flags;
__u64 offset;
char name[0];