posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
poll.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) The Zephyr Project Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
20#ifndef ZEPHYR_INCLUDE_POSIX_POLL_H_
21#define ZEPHYR_INCLUDE_POSIX_POLL_H_
22
23#include <zephyr/sys/fdtable.h>
24#include <zephyr/toolchain.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#if defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__)
31
32#if !defined(_NFDS_T_DECLARED) && !defined(__nfds_t_defined)
34typedef int nfds_t;
35#define _NFDS_T_DECLARED
36#define __nfds_t_defined
37#endif
38
40#define pollfd zvfs_pollfd
41
43#define POLLIN ZVFS_POLLIN
45#define POLLRDNORM ZVFS_POLLRDNORM
47#define POLLRDBAND ZVFS_POLLRDBAND
49#define POLLPRI ZVFS_POLLPRI
51#define POLLOUT ZVFS_POLLOUT
53#define POLLWRNORM ZVFS_POLLWRNORM
55#define POLLWRBAND ZVFS_POLLWRBAND
57#define POLLERR ZVFS_POLLERR
59#define POLLHUP ZVFS_POLLHUP
61#define POLLNVAL ZVFS_POLLNVAL
62
63BUILD_ASSERT(POLLWRNORM == POLLOUT, "POLLWRNORM must be equal to POLLOUT");
64
80int poll(struct pollfd *fds, nfds_t nfds, int timeout);
81
82
83#endif /* _POSIX_C_SOURCE || __DOXYGEN__ */
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif /* ZEPHYR_INCLUDE_POSIX_POLL_H_ */
int nfds_t
Type for the number of file descriptors passed to poll().
Definition poll.h:34
#define POLLOUT
Normal data may be written without blocking.
Definition poll.h:51
int poll(struct zvfs_pollfd *fds, nfds_t nfds, int timeout)
Wait for events on a set of file descriptors.
#define POLLWRNORM
Equivalent to POLLOUT.
Definition poll.h:53
#define pollfd
Poll file descriptor structure (alias for zvfs_pollfd).
Definition poll.h:40