tests: Use `--no-wait` when destroying sessions in relayd-grouping
[lttng-tools.git] / src / common / unix.hpp
1 /*
2 * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef _LTTCOMM_UNIX_H
9 #define _LTTCOMM_UNIX_H
10
11 #include <common/compat/socket.hpp>
12 #include <common/macros.hpp>
13 #include <common/payload-view.hpp>
14 #include <common/payload.hpp>
15
16 #include <limits.h>
17 #include <sys/un.h>
18
19 int lttcomm_create_unix_sock(const char *pathname);
20 int lttcomm_create_anon_unix_socketpair(int *fds);
21 int lttcomm_connect_unix_sock(const char *pathname);
22 int lttcomm_accept_unix_sock(int sock);
23 int lttcomm_listen_unix_sock(int sock);
24 int lttcomm_close_unix_sock(int sock);
25
26 /* Send a message accompanied by fd(s) over a unix socket. */
27 ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd);
28 ssize_t lttcomm_send_payload_view_fds_unix_sock(int sock, struct lttng_payload_view *view);
29 ssize_t lttcomm_send_fds_unix_sock_non_block(int sock, const int *fds, size_t nb_fd);
30 ssize_t lttcomm_send_payload_view_fds_unix_sock_non_block(int sock,
31 struct lttng_payload_view *view);
32
33 /* Recv a message accompanied by fd(s) from a unix socket */
34 ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
35 ssize_t lttcomm_recv_payload_fds_unix_sock(int sock, size_t nb_fd, struct lttng_payload *payload);
36 ssize_t lttcomm_recv_fds_unix_sock_non_block(int sock, int *fds, size_t nb_fd);
37 ssize_t
38 lttcomm_recv_payload_fds_unix_sock_non_block(int sock, size_t nb_fd, struct lttng_payload *payload);
39
40 ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len);
41 ssize_t lttcomm_recv_unix_sock_non_block(int sock, void *buf, size_t len);
42 ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len);
43 ssize_t lttcomm_send_unix_sock_non_block(int sock, const void *buf, size_t len);
44
45 ssize_t lttcomm_send_creds_unix_sock(int sock, const void *buf, size_t len);
46 ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len, lttng_sock_cred *creds);
47
48 int lttcomm_setsockopt_creds_unix_sock(int sock);
49
50 #endif /* _LTTCOMM_UNIX_H */
This page took 0.034247 seconds and 4 git commands to generate.