Implement --shm-path option for UST sessions (per-uid channels)
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index cdc58b8cf1d4b534d959a5e4eb408bfe637c0f09..bf6097b64609097b1cdf60d97400baf72098cc27 100644 (file)
@@ -3333,6 +3333,29 @@ error:
        return ret;
 }
 
+/*
+ * Command LTTNG_SET_SESSION_SHM_PATH processed by the client thread.
+ */
+int cmd_set_session_shm_path(struct ltt_session *session,
+               const char *shm_path)
+{
+       /* Safety net */
+       assert(session);
+
+       /*
+        * Can only set shm path before session is started.
+        */
+       if (session->has_been_started) {
+               return LTTNG_ERR_SESSION_STARTED;
+       }
+
+       strncpy(session->shm_path, shm_path,
+               sizeof(session->shm_path));
+       session->shm_path[sizeof(session->shm_path) - 1] = '\0';
+
+       return 0;
+}
+
 /*
  * Init command subsystem.
  */
This page took 0.02459 seconds and 5 git commands to generate.