36#include_next <sys/select.h>
41#if (defined(MODULE_NEWLIB) || defined(MODULE_PICOLIBC)) && !defined(CPU_ESP8266)
42#include <sys/_timeval.h>
56#define POSIX_SELECT_THREAD_FLAG (1U << 3)
71#ifndef CONFIG_POSIX_FD_SET_SIZE
72#define CONFIG_POSIX_FD_SET_SIZE (16)
77#if !defined(CPU_ESP8266)
83#define FD_SETSIZE (CONFIG_POSIX_FD_SET_SIZE)
115 return (
int)
bf_isset(fdsetp->fds, fd);
137 memset(fdsetp->fds, 0,
sizeof(fdsetp->fds));
bitfields operations on bitfields of arbitrary length
static void bf_set(uint8_t field[], size_t idx)
Set the bit to 1.
static void bf_unset(uint8_t field[], size_t idx)
Clear the bit.
static bool bf_isset(const uint8_t field[], size_t idx)
Check if the bet is set.
static int FD_ISSET(int fd, fd_set *fdsetp)
Checks if a file descriptor is a member of an fd_set
static void FD_SET(int fd, fd_set *fdsetp)
Adds a file descriptor from an fd_set if it is not already a member.
static void FD_ZERO(fd_set *fdsetp)
Initializes the descriptor set as an empty set.
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout)
Examines the given file descriptor sets if they are ready for their respective operation.
#define FD_SETSIZE
Maximum number of file descriptors in an fd_set structure.
static void FD_CLR(int fd, fd_set *fdsetp)
Removes a file descriptor from an fd_set if it is a member.
BITFIELD(fds, FD_SETSIZE)
Bit-field to represent the set of file descriptors.
Definition of struct timeval for the atmega.