#ifndef _LTT_POLL_H
#define _LTT_POLL_H
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <common/common.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Used by lttng_poll_clean to free the events structure in a lttng_poll_event.
*/
free(events);
}
+#ifdef __cplusplus
+}
+#endif
+
/*
* epoll(7) implementation.
*/
#include <features.h>
#include <common/compat/fcntl.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* See man epoll(7) for this define path */
#define COMPAT_EPOLL_PROC_PATH "/proc/sys/fs/epoll/max_user_watches"
static inline int __lttng_epoll_get_prev_fd(struct lttng_poll_event *events,
int index, uint32_t nb_fd)
{
- assert(events);
- assert(index != nb_fd);
+ LTTNG_ASSERT(events);
+ LTTNG_ASSERT(index != nb_fd);
if (index == 0 || nb_fd == 0) {
return -1;
* fcntl(..).
*/
int efd = epoll_create(size);
- assert(fcntl(efd, F_SETFD, flags) != -1);
+ LTTNG_ASSERT(fcntl(efd, F_SETFD, flags) != -1);
return efd;
}
#endif
__lttng_poll_free((void *) events->events);
}
+#ifdef __cplusplus
+}
+#endif
+
#else /* HAVE_EPOLL */
/*
* Fallback on poll(2) API
#include <poll.h>
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum {
/* Polling variables compatibility for poll */
LPOLLIN = POLLIN,
static inline int __lttng_poll_get_prev_fd(struct lttng_poll_event *events,
int index, uint32_t nb_fd)
{
- assert(events);
- assert(index != nb_fd);
+ LTTNG_ASSERT(events);
+ LTTNG_ASSERT(index != nb_fd);
if (index == 0 || nb_fd == 0) {
return -1;
}
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* HAVE_EPOLL */
#endif /* _LTT_POLL_H */