The select() and pselect() system calls modify their arguments (the \'fd_set *\' arguments), so the input value tells the system which file descriptors to check
I don't have enough rep to add this as a comment to caf's answer, but there are libraries to abstract over the non-standard interfaces like epoll() and kqueue. libevent is one, and libev another. I think GLib also has one that ties into its mainloop.