depends on LWIP_THREADS && (LWIP_UDP || LWIP_TCP)
default y
+if LWIP_SOCKET
+ config LWIP_SOCKET_SELECT_GENERIC_FDS
+ bool "Use select() with any file descriptor type"
+ default y
+ help
+ lwip's select() implementation supports only sockets. This
+ configuration option makes it possible to use other file descriptor
+ types as well, even though they are not supported by lwip.
+endif
+
menuconfig LWIP_DEBUG
bool "Debug messages"
default n
if (readfds && FD_ISSET(i, readfds)) {
file = sock_net_file_get(i);
if (PTRISERR(file)) {
+#if CONFIG_LWIP_SOCKET_SELECT_GENERIC_FDS
+ /* We allow other fd types, but we don't support them */
+ if (PTR2ERR(file) == -EBADF) {
+ FD_CLR(i, readfds);
+ continue;
+ }
+#else
LWIP_DEBUGF(SOCKETS_DEBUG,
("failed to identify socket descriptor\n"));
ret = -1;
/* Setting the errno */
SOCK_NET_SET_ERRNO(PTR2ERR(file));
goto EXIT;
+#endif
}
if (maxfd < file->sock_fd)
maxfd = file->sock_fd;
if (writefds && FD_ISSET(i, writefds)) {
file = sock_net_file_get(i);
if (PTRISERR(file)) {
+#if CONFIG_LWIP_SOCKET_SELECT_GENERIC_FDS
+ /* We allow other fd types, but we don't support them */
+ if (PTR2ERR(file) == -EBADF) {
+ FD_CLR(i, writefds);
+ continue;
+ }
+#else
LWIP_DEBUGF(SOCKETS_DEBUG,
("failed to identify socket descriptor\n"));
ret = -1;
/* Setting the errno */
SOCK_NET_SET_ERRNO(PTR2ERR(file));
goto EXIT;
+#endif
}
if (maxfd < file->sock_fd)
maxfd = file->sock_fd;
if (exceptfds && FD_ISSET(i, exceptfds)) {
file = sock_net_file_get(i);
if (PTRISERR(file)) {
+#if CONFIG_LWIP_SOCKET_SELECT_GENERIC_FDS
+ /* We allow other fd types, but we don't support them */
+ if (PTR2ERR(file) == -EBADF) {
+ FD_CLR(i, exceptfds);
+ continue;
+ }
+#else
LWIP_DEBUGF(SOCKETS_DEBUG,
("failed to identify socket descriptor\n"));
ret = -1;
/* Setting the errno */
SOCK_NET_SET_ERRNO(PTR2ERR(file));
goto EXIT;
+#endif
}
if (maxfd < file->sock_fd)
maxfd = file->sock_fd;