Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 42645:a5e984eda45a
Remove support for BeOS
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Fri, 17 Aug 2007 12:57:41 +0000 |
| parents | 4d2aa4bfb2d6 |
| children | 9e81b22689d2 |
line wrap: on
line diff
--- a/Modules/socketmodule.c Fri Aug 17 05:54:09 2007 +0000 +++ b/Modules/socketmodule.c Fri Aug 17 12:57:41 2007 +0000 @@ -242,9 +242,7 @@ # include <netdb.h> /* Headers needed for inet_ntoa() and inet_addr() */ -# ifdef __BEOS__ -# include <net/netdb.h> -# elif defined(PYOS_OS2) && defined(PYCC_VACPP) +# if defined(PYOS_OS2) && defined(PYCC_VACPP) # include <netdb.h> typedef size_t socklen_t; # else @@ -326,8 +324,7 @@ #include "getnameinfo.c" #endif -#if defined(MS_WINDOWS) || defined(__BEOS__) -/* BeOS suffers from the same socket dichotomy as Win32... - [cjh] */ +#if defined(MS_WINDOWS) /* seem to be a few differences in the API */ #define SOCKETCLOSE closesocket #define NO_DUP /* Actually it exists on NT 3.5, but what the heck... */ @@ -650,11 +647,6 @@ #endif Py_BEGIN_ALLOW_THREADS -#ifdef __BEOS__ - block = !block; - setsockopt(s->sock_fd, SOL_SOCKET, SO_NONBLOCK, - (void *)(&block), sizeof(int)); -#else #ifndef MS_WINDOWS #if defined(PYOS_OS2) && !defined(PYCC_GCC) block = !block; @@ -674,7 +666,6 @@ block = !block; ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block); #endif /* MS_WINDOWS */ -#endif /* __BEOS__ */ Py_END_ALLOW_THREADS /* Since these don't return anything */ @@ -992,11 +983,6 @@ return Py_None; } -#ifdef __BEOS__ - /* XXX: BeOS version of accept() doesn't set family correctly */ - addr->sa_family = AF_INET; -#endif - switch (addr->sa_family) { case AF_INET: @@ -1715,12 +1701,6 @@ PyObject *buf; socklen_t buflen = 0; -#ifdef __BEOS__ - /* We have incomplete socket support. */ - PyErr_SetString(socket_error, "getsockopt not supported"); - return NULL; -#else - if (!PyArg_ParseTuple(args, "ii|i:getsockopt", &level, &optname, &buflen)) return NULL; @@ -1759,7 +1739,6 @@ return NULL; } return buf; -#endif /* __BEOS__ */ } PyDoc_STRVAR(getsockopt_doc, @@ -3248,11 +3227,6 @@ { char *name; struct protoent *sp; -#ifdef __BEOS__ -/* Not available in BeOS yet. - [cjh] */ - PyErr_SetString(socket_error, "getprotobyname not supported"); - return NULL; -#else if (!PyArg_ParseTuple(args, "s:getprotobyname", &name)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -3263,7 +3237,6 @@ return NULL; } return PyInt_FromLong((long) sp->p_proto); -#endif } PyDoc_STRVAR(getprotobyname_doc, @@ -4277,14 +4250,12 @@ /* Socket types */ PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM); PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM); -#ifndef __BEOS__ /* We have incomplete socket support. */ PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); #if defined(SOCK_RDM) PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); #endif -#endif #ifdef SO_DEBUG PyModule_AddIntConstant(m, "SO_DEBUG", SO_DEBUG);
