summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-02-11 09:27:05 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-02-11 09:27:05 (GMT)
commitf84d1b9375ff1d761f39f2878c68b09e3db17027 (patch)
treec63caf9410e4b339c8c468c56681b13187a99c94 /Modules/socketmodule.c
parent03ca23d892bae3f3b524f8230e417903c3f5b134 (diff)
downloadcpython-f84d1b9375ff1d761f39f2878c68b09e3db17027.zip
cpython-f84d1b9375ff1d761f39f2878c68b09e3db17027.tar.gz
cpython-f84d1b9375ff1d761f39f2878c68b09e3db17027.tar.bz2
Introduce Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE.
Proposed by Tim Peters.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 1ec3166..a445581 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -396,7 +396,14 @@ static int taskwindow;
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)