* Return the size of sent data.
*/
LTTNG_HIDDEN
-ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
+ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, const void *buf,
size_t len, int flags)
{
struct msghdr msg;
memset(&msg, 0, sizeof(msg));
- iov[0].iov_base = buf;
+ iov[0].iov_base = (void *) buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
extern ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
size_t len, int flags);
-extern ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
- size_t len, int flags);
+extern ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock,
+ const void *buf, size_t len, int flags);
/* Initialize inet communication layer. */
extern void lttcomm_inet_init(void);
* Return the size of sent data.
*/
LTTNG_HIDDEN
-ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
+ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, const void *buf,
size_t len, int flags)
{
struct msghdr msg;
memset(&msg, 0, sizeof(msg));
- iov[0].iov_base = buf;
+ iov[0].iov_base = (void *) buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
extern ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
size_t len, int flags);
-extern ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
- size_t len, int flags);
+extern ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock,
+ const void *buf, size_t len, int flags);
#endif /* _LTTCOMM_INET6_H */
int (*listen) (struct lttcomm_sock *sock, int backlog);
ssize_t (*recvmsg) (struct lttcomm_sock *sock, void *buf, size_t len,
int flags);
- ssize_t (*sendmsg) (struct lttcomm_sock *sock, void *buf, size_t len,
- int flags);
+ ssize_t (*sendmsg) (struct lttcomm_sock *sock, const void *buf,
+ size_t len, int flags);
};
/*
* Return the size of sent data.
*/
LTTNG_HIDDEN
-ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
+ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len)
{
struct msghdr msg;
struct iovec iov[1];
memset(&msg, 0, sizeof(msg));
- iov[0].iov_base = buf;
+ iov[0].iov_base = (void *) buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
msg.msg_iovlen = 1;
LTTNG_HIDDEN
ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len);
LTTNG_HIDDEN
-ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len);
+ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len);
LTTNG_HIDDEN
ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len);
struct lttng_domain *src);
/*
- * Sends the lttcomm message to the session daemon and fills buf of the
+ * Sends the lttcomm message to the session daemon and fills buf if the
* returned data is not NULL.
*
* Return the size of the received data on success or else a negative lttng
* error code. If buf is NULL, 0 is returned on success.
*/
int lttng_ctl_ask_sessiond_varlen(struct lttcomm_session_msg *lsm,
- void *vardata, size_t varlen, void **buf);
+ const void *vardata, size_t varlen, void **buf);
/*
* Use this if no variable length data needs to be sent.
* On success, returns the number of bytes sent (>=0)
* On error, returns -1
*/
-static int send_session_varlen(void *data, size_t len)
+static int send_session_varlen(const void *data, size_t len)
{
int ret;
*/
LTTNG_HIDDEN
int lttng_ctl_ask_sessiond_varlen(struct lttcomm_session_msg *lsm,
- void *vardata, size_t varlen, void **buf)
+ const void *vardata, size_t varlen, void **buf)
{
int ret;
size_t size;