X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Fust-comm.h;h=0eca73a9ecbeecc6fe16247206bb952f43cf87bc;hb=74d81a6cca2cd4a7718bba9368f382f9f2fbba84;hp=b9c4cebe5bb9344600099f79902856d976e5111d;hpb=3f6fd224cc31bdab2e3d8430c3e5e9ff17862c14;p=lttng-ust.git diff --git a/include/ust-comm.h b/include/ust-comm.h index b9c4cebe..0eca73a9 100644 --- a/include/ust-comm.h +++ b/include/ust-comm.h @@ -30,6 +30,7 @@ #include #include #include +#include /* * 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 */