+end:
+ return ret;
+}
+
+/*
+ * ask_sessiond
+ *
+ * Ask the session daemon a specific command
+ * and put the data into buf.
+ *
+ * Return size of data (only payload, not header).
+ */
+static int ask_sessiond(enum lttcomm_command_type lct, void **buf)
+{
+ int ret;
+ size_t size;
+ void *data = NULL;
+ struct lttcomm_lttng_msg llm;
+
+ lsm.cmd_type = lct;
+
+ /* Send command to session daemon */
+ ret = send_data_sessiond();
+ if (ret < 0) {
+ goto end;
+ }
+
+ /* Get header from data transmission */
+ ret = recv_data_sessiond(&llm, sizeof(llm));
+ if (ret < 0) {
+ goto end;
+ }
+
+ /* Check error code if OK */