net: sockets: move select() implementation to zvfs

Move the implementation of zsock_select() to zvfs_select(). This
allows other types of file descriptors to also make use of
select() functionality even when the network subsystem is not
enabled.

Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
This commit is contained in:
Chris Friedt 2024-07-26 22:41:12 -04:00 committed by Henrik Brix Andersen
commit b3d3d4fff7
12 changed files with 148 additions and 83 deletions

View file

@ -22,3 +22,4 @@ CONFIG_POSIX_TIMERS=y
CONFIG_POSIX_MESSAGE_PASSING=y
CONFIG_EVENTFD=y
CONFIG_POSIX_C_LIB_EXT=y
CONFIG_POSIX_DEVICE_IO=y

View file

@ -22,12 +22,14 @@ ZTEST(posix_headers, test_sys_select_h)
fd_set fds = {0};
zassert_not_equal(-1, FD_SETSIZE);
FD_CLR(0, &fds);
FD_ISSET(0, &fds);
FD_SET(0, &fds);
FD_ZERO(&fds);
if (IS_ENABLED(CONFIG_POSIX_DEVICE_IO)) {
FD_CLR(0, &fds);
FD_ISSET(0, &fds);
FD_SET(0, &fds);
FD_ZERO(&fds);
/* zassert_not_null(pselect); */ /* not implemented */
zassert_not_null(select);
}