Clean-up: sessiond: cmd_enable_channel_internal
[lttng-tools.git] / src / common / unix.h
... / ...
CommitLineData
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 <limits.h>
12#include <sys/un.h>
13
14#include <common/compat/socket.h>
15#include <common/macros.h>
16#include <common/payload.h>
17#include <common/payload-view.h>
18
19int lttcomm_create_unix_sock(const char *pathname);
20int lttcomm_create_anon_unix_socketpair(int *fds);
21int lttcomm_connect_unix_sock(const char *pathname);
22int lttcomm_accept_unix_sock(int sock);
23int lttcomm_listen_unix_sock(int sock);
24int lttcomm_close_unix_sock(int sock);
25
26/* Send a message accompanied by fd(s) over a unix socket. */
27ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd);
28ssize_t lttcomm_send_payload_view_fds_unix_sock(int sock,
29 struct lttng_payload_view *view);
30ssize_t lttcomm_send_fds_unix_sock_non_block(
31 int sock, const int *fds, size_t nb_fd);
32ssize_t lttcomm_send_payload_view_fds_unix_sock_non_block(int sock,
33 struct lttng_payload_view *view);
34
35/* Recv a message accompanied by fd(s) from a unix socket */
36ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
37ssize_t lttcomm_recv_payload_fds_unix_sock(int sock, size_t nb_fd,
38 struct lttng_payload *payload);
39ssize_t lttcomm_recv_fds_unix_sock_non_block(int sock, int *fds, size_t nb_fd);
40ssize_t lttcomm_recv_payload_fds_unix_sock_non_block(int sock, size_t nb_fd,
41 struct lttng_payload *payload);
42
43ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len);
44ssize_t lttcomm_recv_unix_sock_non_block(int sock, void *buf, size_t len);
45ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len);
46ssize_t lttcomm_send_unix_sock_non_block(int sock, const void *buf, size_t len);
47
48ssize_t lttcomm_send_creds_unix_sock(int sock, const void *buf, size_t len);
49ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
50 lttng_sock_cred *creds);
51
52int lttcomm_setsockopt_creds_unix_sock(int sock);
53
54#endif /* _LTTCOMM_UNIX_H */
This page took 0.023043 seconds and 4 git commands to generate.