Fix: consumerd: unbalanced subbuffer 'get' when checking operation availability
[lttng-tools.git] / src / common / fd-tracker / utils.h
1 /*
2 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8 #ifndef FD_TRACKER_UTILS_H
9 #define FD_TRACKER_UTILS_H
10
11 #include <common/compat/directory-handle.h>
12 #include <common/fd-tracker/fd-tracker.h>
13 #include <common/macros.h>
14
15 struct lttng_poll_event;
16
17 /*
18 * Utility implementing a close_fd callback which receives one file descriptor
19 * and closes it, returning close()'s return value.
20 */
21 LTTNG_HIDDEN
22 int fd_tracker_util_close_fd(void *, int *fd);
23
24 /*
25 * Create a pipe and track its underlying fds.
26 */
27 LTTNG_HIDDEN
28 int fd_tracker_util_pipe_open_cloexec(
29 struct fd_tracker *tracker, const char *name, int *pipe);
30 LTTNG_HIDDEN
31 int fd_tracker_util_pipe_close(struct fd_tracker *tracker, int *pipe);
32
33 /*
34 * Create a poll event and track its underlying fd, if applicable.
35 */
36 LTTNG_HIDDEN
37 int fd_tracker_util_poll_create(struct fd_tracker *tracker,
38 const char *name,
39 struct lttng_poll_event *events,
40 int size,
41 int flags);
42 LTTNG_HIDDEN
43 int fd_tracker_util_poll_clean(
44 struct fd_tracker *tracker, struct lttng_poll_event *events);
45
46 LTTNG_HIDDEN
47 struct lttng_directory_handle *fd_tracker_create_directory_handle(
48 struct fd_tracker *tracker, const char *path);
49
50 LTTNG_HIDDEN
51 struct lttng_directory_handle *fd_tracker_create_directory_handle_from_handle(
52 struct fd_tracker *tracker,
53 struct lttng_directory_handle *handle,
54 const char *path);
55
56 #endif /* FD_TRACKER_UTILS_H */
This page took 0.030028 seconds and 4 git commands to generate.