Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 902:a4793ae26682 legacy-trunk
Changes for new UNIX-specific built-in module 'select' and new header for
interfaces to variants of select() system call, "myselect.h". This includes
adding fileno() methods to files, sockets and stdwin.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 23 Jun 1992 09:07:03 +0000 |
| parents | 58a7438c2e7e |
| children | 61143bf03b44 |
line wrap: on
line diff
--- a/Modules/socketmodule.c Fri Jun 19 13:57:27 1992 +0000 +++ b/Modules/socketmodule.c Tue Jun 23 09:07:03 1992 +0000 @@ -73,17 +73,13 @@ #include "allobjects.h" #include "modsupport.h" +#include "myselect.h" /* Implies <sys/types.h>, <sys/time.h>, <sys/param.h> */ + #include <signal.h> -#include <sys/types.h> #include <sys/socket.h> -#include <sys/time.h> /* Needed for struct timeval */ #include <netinet/in.h> #include <sys/un.h> #include <netdb.h> -#ifdef _AIX /* I *think* this works */ -/* AIX defines fd_set in a separate file. Sigh... */ -#include <sys/select.h> -#endif /* Global variable holding the exception type for errors detected @@ -526,6 +522,19 @@ } +/* s.fileno() method */ + +static object * +sock_fileno(s, args) + sockobject *s; + object *args; +{ + if (!getnoarg(args)) + return NULL; + return newintobject((long) s->sock_fd); +} + + /* s.listen(n) method */ static object * @@ -699,6 +708,7 @@ {"bind", sock_bind}, {"close", sock_close}, {"connect", sock_connect}, + {"fileno", sock_fileno}, {"listen", sock_listen}, {"makefile", sock_makefile}, {"recv", sock_recv},
