[WIP] bpo-28708: Add setsize keywoard-only parameter to select.select() by vstinner · Pull Request #13845 · python/cpython (original) (raw)
I think these three sets will need to be allocated differently. We'll probably need a different fd_set structure something like:
typedef struct fd_set_2
{
u_int fd_count
SOCKET *fd_array;
} fd_set_2;
and then dynamically allocate the fd_array to be a SOCKET* array of size set_size.
Knowing that the select implementation only looks at the fd_count for the size of the array (and doesn't do any boundary checking), we can cast those sets to fd_set and then pass them to the select call.