unix: add non block send and receive flavors for fd passing
[lttng-tools.git] / src / common / unix.h
CommitLineData
0d37f2bc 1/*
ab5be9fa 2 * Copyright (C) 2012 David Goulet <dgoulet@efficios.com>
0d37f2bc 3 *
ab5be9fa 4 * SPDX-License-Identifier: GPL-2.0-only
0d37f2bc 5 *
0d37f2bc
DG
6 */
7
8#ifndef _LTTCOMM_UNIX_H
9#define _LTTCOMM_UNIX_H
10
0d37f2bc
DG
11#include <limits.h>
12#include <sys/un.h>
13
14#include <common/compat/socket.h>
8d9eb6d8 15#include <common/macros.h>
0d37f2bc 16
8d9eb6d8
JG
17LTTNG_HIDDEN
18int lttcomm_create_unix_sock(const char *pathname);
19LTTNG_HIDDEN
20int lttcomm_create_anon_unix_socketpair(int *fds);
21LTTNG_HIDDEN
22int lttcomm_connect_unix_sock(const char *pathname);
23LTTNG_HIDDEN
24int lttcomm_accept_unix_sock(int sock);
25LTTNG_HIDDEN
26int lttcomm_listen_unix_sock(int sock);
27LTTNG_HIDDEN
28int lttcomm_close_unix_sock(int sock);
0d37f2bc
DG
29
30/* Send a message accompanied by fd(s) over a unix socket. */
8d9eb6d8 31LTTNG_HIDDEN
ac2f30af 32ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd);
b72ce630
JR
33LTTNG_HIDDEN
34ssize_t lttcomm_send_fds_unix_sock_non_block(
35 int sock, const int *fds, size_t nb_fd);
0d37f2bc 36/* Recv a message accompanied by fd(s) from a unix socket */
8d9eb6d8
JG
37LTTNG_HIDDEN
38ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
b72ce630
JR
39LTTNG_HIDDEN
40ssize_t lttcomm_recv_fds_unix_sock_non_block(int sock, int *fds, size_t nb_fd);
0d37f2bc 41
8d9eb6d8
JG
42LTTNG_HIDDEN
43ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len);
44LTTNG_HIDDEN
c72435ad
JG
45ssize_t lttcomm_recv_unix_sock_non_block(int sock, void *buf, size_t len);
46LTTNG_HIDDEN
c2d69327 47ssize_t lttcomm_send_unix_sock(int sock, const void *buf, size_t len);
c72435ad
JG
48LTTNG_HIDDEN
49ssize_t lttcomm_send_unix_sock_non_block(int sock, const void *buf, size_t len);
0d37f2bc 50
8d9eb6d8
JG
51LTTNG_HIDDEN
52ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len);
53LTTNG_HIDDEN
54ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
0d37f2bc
DG
55 lttng_sock_cred *creds);
56
8d9eb6d8
JG
57LTTNG_HIDDEN
58int lttcomm_setsockopt_creds_unix_sock(int sock);
0d37f2bc
DG
59
60#endif /* _LTTCOMM_UNIX_H */
This page took 0.080839 seconds and 4 git commands to generate.