Setup.in: added tkinter; rearranged the definition of PYTHONPATH so
that the module-specific components are in the section for that
module.
cursesmodule.c: patched it so it actually works.
tkintermodule.c: call Py_AtExit instead of atexit().
signalmodule.c: converted to new naming style; added
BGN/END SAVE around pause() call.
socketmodule.c: added setblocking() after Tommy Burnette.
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 8cacfb2..6f50fc3 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -63,6 +63,7 @@
- s.recvfrom(nbytes [,flags]) --> string, sockaddr
- s.send(string [,flags]) --> nbytes
- s.sendto(string, [flags,] sockaddr) --> nbytes
+- s.setblocking(1 | 0) --> None
- s.shutdown(how) --> None
- s.close() --> None
@@ -80,6 +81,7 @@
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
+#include <fcntl.h>
#else
#include <winsock.h>
#endif
@@ -441,6 +443,34 @@
#endif
+#ifndef NT
+
+/* s.setblocking(1 | 0) method */
+
+static object *
+sock_setblocking(s, args)
+ sockobject *s;
+ object *args;
+{
+ int block;
+ int delay_flag;
+ if (!getintarg(args, &block))
+ return NULL;
+ BGN_SAVE
+ delay_flag = fcntl (s->sock_fd, F_GETFL, 0);
+ if (block)
+ delay_flag &= (~O_NDELAY);
+ else
+ delay_flag |= O_NDELAY;
+ fcntl (s->sock_fd, F_SETFL, delay_flag);
+ END_SAVE
+
+ INCREF(None);
+ return None;
+}
+#endif
+
+
/* s.setsockopt() method.
With an integer third argument, sets an integer option.
With a string third argument, sets an option from a buffer;
@@ -813,6 +843,9 @@
#if 0
{"allowbroadcast", (method)sock_allowbroadcast},
#endif
+#ifndef NT
+ {"setblocking", (method)sock_setblocking},
+#endif
{"setsockopt", (method)sock_setsockopt},
{"getsockopt", (method)sock_getsockopt},
{"bind", (method)sock_bind},