Tests: add unix socket wrapper unit tests
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.h
index 0b4c05fb795359b3e936008024d41c68eaf3288d..d054a8bd05a1f49fef96a1fe8051586a6183bd02 100644 (file)
 #define LTTNG_SESSIOND_COMM_MAX_LISTEN 64
 
 /* Maximum number of FDs that can be sent over a Unix socket */
-#define LTTCOMM_MAX_SEND_FDS           4
+#if defined(__linux__)
+/* Based on the kernel's SCM_MAX_FD which is 253 since 2.6.38 (255 before) */
+#define LTTCOMM_MAX_SEND_FDS           253
+#else
+#define LTTCOMM_MAX_SEND_FDS           16
+#endif
 
 /*
  * Get the error code index from 0 since LTTCOMM_OK start at 1000
@@ -179,6 +184,7 @@ enum lttcomm_return_code {
        LTTCOMM_CONSUMERD_TRACE_CHUNK_EXISTS_REMOTE,/* Trace chunk exists on relay daemon. */
        LTTCOMM_CONSUMERD_UNKNOWN_TRACE_CHUNK,      /* Unknown trace chunk. */
        LTTCOMM_CONSUMERD_RELAYD_CLEAR_DISALLOWED,  /* Relayd does not accept clear command. */
+       LTTCOMM_CONSUMERD_UNKNOWN_ERROR,            /* Unknown error. */
 
        /* MUST be last element */
        LTTCOMM_NR,                                             /* Last element */
@@ -501,6 +507,7 @@ struct lttcomm_lttng_msg {
        uint32_t pid;           /* pid_t */
        uint32_t cmd_header_size;
        uint32_t data_size;
+       uint32_t fd_count;
 } LTTNG_PACKED;
 
 struct lttcomm_lttng_output_id {
@@ -705,6 +712,9 @@ struct lttcomm_consumer_msg {
                struct {
                        uint64_t key;
                } LTTNG_PACKED clear_channel;
+               struct {
+                       uint64_t key;
+               } LTTNG_PACKED open_channel_packets;
        } u;
 } LTTNG_PACKED;
 
This page took 0.02432 seconds and 5 git commands to generate.