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
select.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_SYS_SELECT_H_
7#define ZEPHYR_INCLUDE_POSIX_SYS_SELECT_H_
8
10#include <sys/_timeval.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#ifndef CONFIG_NET_SOCKETS_POSIX_NAMES
17
18#define fd_set zsock_fd_set
19#define FD_SETSIZE ZSOCK_FD_SETSIZE
20#define FD_ZERO ZSOCK_FD_ZERO
21#define FD_SET ZSOCK_FD_SET
22#define FD_CLR ZSOCK_FD_CLR
23#define FD_ISSET ZSOCK_FD_ISSET
24
25struct timeval;
26
27static inline int select(int nfds, fd_set *readfds,
28 fd_set *writefds, fd_set *exceptfds,
29 struct timeval *timeout)
30{
31 return zsock_select(nfds, readfds, writefds, exceptfds,
32 (struct zsock_timeval *)timeout);
33}
34
35#endif /* CONFIG_NET_SOCKETS_POSIX_NAMES */
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif /* ZEPHYR_INCLUDE_POSIX_SYS_SELECT_H_ */
#define zsock_timeval
Definition: socket_types.h:49
int zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds, zsock_fd_set *exceptfds, struct zsock_timeval *timeout)
Legacy function to poll multiple sockets for events.
#define fd_set
Definition: socket_select.h:111
static int select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds, zsock_fd_set *exceptfds, struct timeval *timeout)
Definition: socket_select.h:114
Definition: _timeval.h:22