function intersect_fds

static int intersect_fds(fd_set *src, fd_set *dst, int max)