Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 36486:65ae730b6231 2.4
Backport r42314 which fixed Windows breakage when checking that socket
descriptors fit in fd_set.
Introduce Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE.
Proposed by Tim Peters implemented by Martin von Loewis.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 12 Feb 2006 21:07:17 +0000 |
| parents | af67b6265af6 |
| children | 4d7653e5cb3b |
line wrap: on
line diff
--- a/Modules/socketmodule.c Sat Feb 11 18:21:44 2006 +0000 +++ b/Modules/socketmodule.c Sun Feb 12 21:07:17 2006 +0000 @@ -391,7 +391,14 @@ static PyTypeObject sock_type; /* Can we call select() with this socket without a buffer overrun? */ +#ifdef Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE +/* Platform can select file descriptors beyond FD_SETSIZE */ +#define IS_SELECTABLE(s) 1 +#else +/* POSIX says selecting file descriptors beyond FD_SETSIZE + has undefined behaviour. */ #define IS_SELECTABLE(s) ((s)->sock_fd < FD_SETSIZE) +#endif static PyObject* select_error(void)
