File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525#endif
2626
2727/* Enable GNU extensions for accept4() on Linux/glibc. Must be defined
28- * before any system headers are included. */
29- #if !defined(_WIN32 ) && !defined(_GNU_SOURCE )
28+ * before any system headers are included. Excluded for Zephyr and other
29+ * embedded RTOSes whose libc layers conflict with glibc-style definitions
30+ * (e.g., Zephyr's socket_select.h vs. glibc's fd_set). */
31+ #if (defined(__linux__ ) || defined(__ANDROID__ )) && \
32+ !defined(__ZEPHYR__ ) && !defined(_GNU_SOURCE )
3033 #define _GNU_SOURCE 1
3134#endif
3235
@@ -1630,8 +1633,8 @@ int wolfIO_TcpBind(SOCKET_T* sockfd, word16 port)
16301633int wolfIO_TcpAccept (SOCKET_T sockfd , SOCKADDR * peer_addr , XSOCKLENT * peer_len )
16311634{
16321635 int fd ;
1633- #if !defined(USE_WINDOWS_API ) && defined(SOCK_CLOEXEC ) && \
1634- (defined(__linux__ ) || defined(__ANDROID__ ))
1636+ #if !defined(USE_WINDOWS_API ) && ! defined(__ZEPHYR__ ) && \
1637+ defined( SOCK_CLOEXEC ) && (defined(__linux__ ) || defined(__ANDROID__ ))
16351638 fd = (int )accept4 (sockfd , peer_addr , peer_len , SOCK_CLOEXEC );
16361639#else
16371640 fd = (int )accept (sockfd , peer_addr , peer_len );
You can’t perform that action at this time.
0 commit comments