Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
poll.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Linaro Limited
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_POSIX_POLL_H_
7#define ZEPHYR_INCLUDE_POSIX_POLL_H_
8
9#include <zephyr/net/socket.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES
16
17#define pollfd zsock_pollfd
18
19#define POLLIN ZSOCK_POLLIN
20#define POLLOUT ZSOCK_POLLOUT
21#define POLLERR ZSOCK_POLLERR
22#define POLLHUP ZSOCK_POLLHUP
23#define POLLNVAL ZSOCK_POLLNVAL
24
25static inline int poll(struct pollfd *fds, int nfds, int timeout)
26{
27 return zsock_poll(fds, nfds, timeout);
28}
29
30#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */
31
32#ifdef __cplusplus
33}
34#endif
35
36#endif /* ZEPHYR_INCLUDE_POSIX_POLL_H_ */
int zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout)
Efficiently poll multiple sockets for events.
static int poll(struct zsock_pollfd *fds, int nfds, int timeout)
POSIX wrapper for zsock_poll.
Definition: socket.h:866
#define pollfd
Definition: socket.h:751
BSD Sockets compatible API definitions.