port: FreeBSD has no ENODATA, alias it to ENOATTR
[lttng-tools.git] / src / common / unix.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-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
19LTTNG_HIDDEN
20int lttcomm_create_unix_sock(const char *pathname);
21LTTNG_HIDDEN
22int lttcomm_create_anon_unix_socketpair(int *fds);
23LTTNG_HIDDEN
24int lttcomm_connect_unix_sock(const char *pathname);
25LTTNG_HIDDEN
26int lttcomm_accept_unix_sock(int sock);
27LTTNG_HIDDEN
28int lttcomm_listen_unix_sock(int sock);
29LTTNG_HIDDEN
30int lttcomm_close_unix_sock(int sock);
31
32/* Send a message accompanied by fd(s) over a unix socket. */
33LTTNG_HIDDEN
34ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd);
35LTTNG_HIDDEN
36ssize_t lttcomm_send_payload_view_fds_unix_sock(int sock,
37 struct lttng_payload_view *view);
38LTTNG_HIDDEN
39ssize_t lttcomm_send_fds_unix_sock_non_block(
40 int sock, const int *fds, size_t nb_fd);
41LTTNG_HIDDEN
42ssize_t lttcomm_send_payload_view_fds_unix_sock_non_block(int sock,
43 struct lttng_payload_view *view);
44
45/* Recv a message accompanied by fd(s) from a unix socket */
46LTTNG_HIDDEN
47ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
48LTTNG_HIDDEN
49ssize_t lttcomm_recv_payload_fds_unix_sock(int sock, size_t nb_fd,
50 struct lttng_payload *payload);
51LTTNG_HIDDEN
52ssize_t lttcomm_recv_fds_unix_sock_non_block(int sock, int *fds, size_t nb_fd);
53LTTNG_HIDDEN
54ssize_t lttcomm_recv_payload_fds_unix_sock_non_block(int sock, size_t nb_fd,
55 struct lttng_payload *payload);
56
57LTTNG_HIDDEN
58ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len);
59LTTNG_HIDDEN
60ssize_t lttcomm_recv_unix_sock_non_block(int sock, void *buf, size_t len);
61LTTNG_HIDDEN
62ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len);
63LTTNG_HIDDEN
64ssize_t lttcomm_send_unix_sock_non_block(int sock, const void *buf, size_t len);
65
66LTTNG_HIDDEN
67ssize_t lttcomm_send_creds_unix_sock(int sock, const void *buf, size_t len);
68LTTNG_HIDDEN
69ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
70 lttng_sock_cred *creds);
71
72LTTNG_HIDDEN
73int lttcomm_setsockopt_creds_unix_sock(int sock);
74
75#endif /* _LTTCOMM_UNIX_H */
This page took 0.022926 seconds and 4 git commands to generate.