Can't believe they're running on Windows. Yikes.
Before each call to select, you'll have to FD_ZERO the fd set(s), then individually FD_SET each fd you're interested in. If that's a large number of fds, then that's quite some overhead.
if P does not point to valid memory, then dereferencing it is UB. Therefore, the compiler is at liberty to do whatever it wants (whether or not that is a good idea is irrelevant for the purposes of this consideration).…
Can't believe they're running on Windows. Yikes.
Before each call to select, you'll have to FD_ZERO the fd set(s), then individually FD_SET each fd you're interested in. If that's a large number of fds, then that's quite some overhead.
if P does not point to valid memory, then dereferencing it is UB. Therefore, the compiler is at liberty to do whatever it wants (whether or not that is a good idea is irrelevant for the purposes of this consideration).…