select() system call in Linux vs. other *nix flavors

From the Linux Programmer’s Manual:
“On Linux, the function select modifies timeout to reflect the amount of time not slept; most other implementations do not do this. This causes problem both when Linux code which reads timeout is ported to other operating systems, and when code is ported to Linux that reuses a struct timeval for multiple selects in a loop without reinitializing it. Consider timeout to be undefined after select returns.”

Leave a Reply

%d bloggers like this: