+ /* Stop right now if no apps */
+ if (traceable_app_count == 0) {
+ ret = LTTCOMM_NO_APPS;
+ goto error;
+ }
+
+ /* Setup data buffer and details for transmission */
+ buf_size = setup_data_buffer(&send_buf,
+ sizeof(pid_t) * traceable_app_count, &llm);
+ if (buf_size < 0) {
+ ret = LTTCOMM_FATAL;
+ goto error;
+ }
+
+ get_list_apps(send_buf + sizeof(struct lttcomm_lttng_msg));
+
+ ret = send_unix_sock(sock, send_buf, buf_size);
+ if (ret < 0) {
+ goto send_error;
+ }
+
+ break;
+ }
+ case LTTNG_LIST_SESSIONS:
+ {
+ /* Stop right now if no session */
+ if (session_count == 0) {
+ ret = LTTCOMM_NO_SESS;
+ goto error;
+ }
+
+ /* Setup data buffer and details for transmission */
+ buf_size = setup_data_buffer(&send_buf,
+ (sizeof(struct lttng_session) * session_count), &llm);
+ if (buf_size < 0) {
+ ret = LTTCOMM_FATAL;
+ goto error;
+ }
+
+ get_list_sessions(send_buf + sizeof(struct lttcomm_lttng_msg));
+
+ ret = send_unix_sock(sock, send_buf, buf_size);
+ if (ret < 0) {
+ goto send_error;
+ }
+