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