/*
- * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: LGPL-2.1-only
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _LTT_POLL_H
#define _LTT_POLL_H
-#include <assert.h>
#include <string.h>
#include <unistd.h>
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
LPOLLRDBAND = POLLRDBAND,
LPOLLWRNORM = POLLWRNORM,
LPOLLWRBAND = POLLWRBAND,
-#if __linux__
+#ifdef __linux__
LPOLLMSG = POLLMSG,
LPOLLRDHUP = POLLRDHUP,
#elif (defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__sun__) || defined(__APPLE__))
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;
/*
* No need to reset a pollfd structure for poll(2)
*/
-static inline void lttng_poll_reset(struct lttng_poll_event *events)
+static inline void lttng_poll_reset(
+ struct lttng_poll_event *events __attribute__((unused)))
{}
/*