|
|
|
|
|
by danadam
376 days ago
|
|
> trace it down to the select bitset having a hardcoded max of 4096 Did it change? Last time I checked it was 1024 (though it was long time ago). > and no bounds checking! _FORTIFY_SOURCE is not set? When I try to pass 1024 to FD_SET and FD_CLR on my (very old) machine I immediately get: *** buffer overflow detected ***: ./a.out terminated
Aborted
(ok, with -O1 and higher) |
|
Yes, _FORTIFY_SOURCE is a fabulous idea. I was just a bit shocked it wasn’t checked without _FORTIFY_SOURCE. If you’re doing FD_SET/FD_CLR, you’re about to make an (expensive) syscall. Why do you care to elide a cheap not-taken branch that’ll save your bacon some day? The overhead is so incredibly negligible.
Anyways, seriously just use poll(). The select() syscall needs to go away for good.