diff --git a/sys/posix/include/sys/select.h b/sys/posix/include/sys/select.h index 8bf98f7c42..afe63aac15 100644 --- a/sys/posix/include/sys/select.h +++ b/sys/posix/include/sys/select.h @@ -29,6 +29,13 @@ #ifndef SYS_SELECT_H #define SYS_SELECT_H +#ifdef CPU_NATIVE +/* On native, system headers may depend on system's . Hence, + * include the real sys/select.h here. */ +__extension__ +#include_next +#endif + #include /* prevent cyclic dependency with newlib/picolibc's `sys/types.h` */ #if (defined(MODULE_NEWLIB) || defined(MODULE_PICOLIBC)) && !defined(CPU_ESP8266) @@ -43,6 +50,13 @@ extern "C" { #endif +/** + * @brief @ref core_thread_flags for POSIX select + */ +#define POSIX_SELECT_THREAD_FLAG (1U << 3) + +#ifndef CPU_NATIVE + /** * @addtogroup config_posix * @{ @@ -59,11 +73,6 @@ extern "C" { #endif /** @} */ -/** - * @brief @ref core_thread_flags for POSIX select - */ -#define POSIX_SELECT_THREAD_FLAG (1U << 3) - /* ESP's newlib has this already defined in `sys/types.h` */ #if !defined(CPU_ESP8266) /** @@ -164,6 +173,8 @@ static inline void FD_ZERO(fd_set *fdsetp) int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout); +#endif /* CPU_NATIVE */ + #ifdef __cplusplus } #endif