2 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: GPL-2.0-only
8 #include <common/compat/poll.h>
13 struct lttng_poll_event
*events
;
18 static int open_epoll(void *data
, int *out_fd
)
21 struct create_args
*args
= data
;
23 ret
= lttng_poll_create(args
->events
, args
->size
, args
->flags
);
28 *out_fd
= args
->events
->epfd
;
33 static int close_epoll(void *data
, int *in_fd
)
35 /* Will close the epfd. */
36 lttng_poll_clean((struct lttng_poll_event
*) data
);
41 * The epoll variant of the poll compat layer creates an unsuspendable fd which
44 int fd_tracker_util_poll_create(struct fd_tracker
*tracker
,
46 struct lttng_poll_event
*events
,
51 struct create_args create_args
= {
57 return fd_tracker_open_unsuspendable_fd(
58 tracker
, &out_fd
, &name
, 1, open_epoll
, &create_args
);
61 int fd_tracker_util_poll_clean(
62 struct fd_tracker
*tracker
, struct lttng_poll_event
*events
)
64 return fd_tracker_close_unsuspendable_fd(
65 tracker
, &events
->epfd
, 1, close_epoll
, events
);
This page took 0.031797 seconds and 5 git commands to generate.