+ if (name) {
+ /* The kernel side is pretty picky about the character
+ * set here, let's do the usual bus escaping to deal
+ * with that. */
+
+ g = sd_bus_label_escape(name);
+ if (!g)
+ return -ENOMEM;
+
+ name = g;
+
+ } else {
+ char pr[17] = {};
+
+ /* If no name is specified we generate one. We include
+ * a hint indicating our library implementation, and
+ * add the thread name to it */
+
+ assert_se(prctl(PR_GET_NAME, (unsigned long) pr) >= 0);
+
+ if (isempty(pr))
+ name = "sd";
+ else {
+ _cleanup_free_ char *e = NULL;
+
+ e = sd_bus_label_escape(pr);
+ if (!e)
+ return -ENOMEM;
+
+ g = strappend("sd-", e);
+ if (!g)
+ return -ENOMEM;
+
+ name = g;
+ }
+ }
+
+ l = strlen(name);
+ sz = ALIGN8(offsetof(struct kdbus_cmd_memfd_make, items)) +
+ ALIGN8(offsetof(struct kdbus_item, str)) +
+ l + 1;
+ cmd = alloca0(sz);
+ cmd->size = sz;
+ item = cmd->items;
+ item->size = ALIGN8(offsetof(struct kdbus_item, str)) + l + 1;
+ item->type = KDBUS_ITEM_MEMFD_NAME;
+ memcpy(item->str, name, l + 1);
+
+ if (ioctl(kdbus, KDBUS_CMD_MEMFD_NEW, cmd) < 0)