> Then you have to convince the Linux man page and the python3.2 > developers too. From python3.2: > ./Include/fileobject.h: #define _PyIsSelectable_fd(FD) (((FD) >= 0) && > ((FD) < FD_SETSIZE))
The fd value itself has to be < FD_SETSIZE, since indexing is zero-origin; so that code is right. The nfds argument to select is highest_fd+1 (i.e. has to be 1 if the only fd in your fd_set is fd 0), so <= FD_SETSIZE is the right test there.