2 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #ifndef FD_TRACKER_UTILS_H
9 #define FD_TRACKER_UTILS_H
11 #include <common/compat/directory-handle.h>
12 #include <common/fd-tracker/fd-tracker.h>
13 #include <common/macros.h>
15 struct lttng_poll_event
;
18 * Utility implementing a close_fd callback which receives one file descriptor
19 * and closes it, returning close()'s return value.
22 int fd_tracker_util_close_fd(void *, int *fd
);
25 * Create a pipe and track its underlying fds.
28 int fd_tracker_util_pipe_open_cloexec(
29 struct fd_tracker
*tracker
, const char *name
, int *pipe
);
31 int fd_tracker_util_pipe_close(struct fd_tracker
*tracker
, int *pipe
);
34 * Create a poll event and track its underlying fd, if applicable.
37 int fd_tracker_util_poll_create(struct fd_tracker
*tracker
,
39 struct lttng_poll_event
*events
,
43 int fd_tracker_util_poll_clean(
44 struct fd_tracker
*tracker
, struct lttng_poll_event
*events
);
47 struct lttng_directory_handle
*fd_tracker_create_directory_handle(
48 struct fd_tracker
*tracker
, const char *path
);
51 struct lttng_directory_handle
*fd_tracker_create_directory_handle_from_handle(
52 struct fd_tracker
*tracker
,
53 struct lttng_directory_handle
*handle
,
56 #endif /* FD_TRACKER_UTILS_H */
This page took 0.031843 seconds and 5 git commands to generate.