Move LTTng-UST buffer ownership from application to consumer
[lttng-ust.git] / include / ust-comm.h
index b9c4cebe5bb9344600099f79902856d976e5111d..0eca73a9ecbeecc6fe16247206bb952f43cf87bc 100644 (file)
@@ -30,6 +30,7 @@
 #include <unistd.h>
 #include <lttng/ust-abi.h>
 #include <lttng/ust-error.h>
+#include <lttng/ust-compiler.h>
 
 /*
  * Default timeout the application waits for the sessiond to send its
@@ -71,9 +72,9 @@ struct ustcomm_ust_msg {
                        uint32_t data_size;     /* following filter data */
                        uint32_t reloc_offset;
                        uint64_t seqnum;
-               } filter;
+               } LTTNG_PACKED filter;
        } u;
-};
+} LTTNG_PACKED;
 
 /*
  * Data structure for the response from UST to the session daemon.
@@ -87,14 +88,14 @@ struct ustcomm_ust_reply {
        union {
                struct {
                        uint64_t memory_map_size;
-               } channel;
+               } LTTNG_PACKED channel;
                struct {
                        uint64_t memory_map_size;
-               } stream;
+               } LTTNG_PACKED stream;
                struct lttng_ust_tracer_version version;
                struct lttng_ust_tracepoint_iter tracepoint;
        } u;
-};
+} LTTNG_PACKED;
 
 /*
  * LTTNG_UST_TRACEPOINT_FIELD_LIST reply is followed by a
@@ -106,11 +107,12 @@ extern int ustcomm_connect_unix_sock(const char *pathname);
 extern int ustcomm_accept_unix_sock(int sock);
 extern int ustcomm_listen_unix_sock(int sock);
 extern int ustcomm_close_unix_sock(int sock);
-/* Send fd(s) over a unix socket. */
-extern ssize_t ustcomm_send_fds_unix_sock(int sock, void *buf, int *fds,
-               size_t nb_fd, size_t len);
+
 extern ssize_t ustcomm_recv_unix_sock(int sock, void *buf, size_t len);
 extern ssize_t ustcomm_send_unix_sock(int sock, void *buf, size_t len);
+extern ssize_t ustcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd);
+extern ssize_t ustcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
+
 extern const char *ustcomm_get_readable_code(int code);
 extern int ustcomm_send_app_msg(int sock, struct ustcomm_ust_msg *lum);
 extern int ustcomm_recv_app_reply(int sock, struct ustcomm_ust_reply *lur,
@@ -120,4 +122,10 @@ extern int ustcomm_send_app_cmd(int sock,
                struct ustcomm_ust_reply *lur);
 int ustcomm_recv_fd(int sock);
 
+ssize_t ustcomm_recv_channel_from_sessiond(int sock,
+               void **chan_data, uint64_t len);
+int ustcomm_recv_stream_from_sessiond(int sock,
+               uint64_t *memory_map_size,
+               int *shm_fd, int *wakeup_fd);
+
 #endif /* _LTTNG_UST_COMM_H */
This page took 0.02459 seconds and 4 git commands to generate.