2 * Copyright (C) 2018 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #include <common/compat/poll.h>
23 struct lttng_poll_event
*events
;
28 static int open_epoll(void *data
, int *out_fd
)
31 struct create_args
*args
= data
;
33 ret
= lttng_poll_create(args
->events
, args
->size
, args
->flags
);
38 *out_fd
= args
->events
->epfd
;
43 static int close_epoll(void *data
, int *in_fd
)
45 /* Will close the epfd. */
46 lttng_poll_clean((struct lttng_poll_event
*) data
);
51 * The epoll variant of the poll compat layer creates an unsuspendable fd which
54 int fd_tracker_util_poll_create(struct fd_tracker
*tracker
,
56 struct lttng_poll_event
*events
,
61 struct create_args create_args
= {
67 return fd_tracker_open_unsuspendable_fd(
68 tracker
, &out_fd
, &name
, 1, open_epoll
, &create_args
);
71 int fd_tracker_util_poll_clean(
72 struct fd_tracker
*tracker
, struct lttng_poll_event
*events
)
74 return fd_tracker_close_unsuspendable_fd(
75 tracker
, &events
->epfd
, 1, close_epoll
, events
);
This page took 0.031917 seconds and 5 git commands to generate.