diff options
Diffstat (limited to 'Modules')
| -rw-r--r-- | Modules/_cryptmodule.c | 7 | ||||
| -rw-r--r-- | Modules/fcntlmodule.c | 4 | ||||
| -rw-r--r-- | Modules/fpectlmodule.c | 29 | ||||
| -rw-r--r-- | Modules/getpath.c | 6 | ||||
| -rw-r--r-- | Modules/grpmodule.c | 5 | ||||
| -rw-r--r-- | Modules/main.c | 29 | ||||
| -rw-r--r-- | Modules/mmapmodule.c | 6 | ||||
| -rw-r--r-- | Modules/posixmodule.c | 23 | ||||
| -rw-r--r-- | Modules/pwdmodule.c | 8 | ||||
| -rw-r--r-- | Modules/selectmodule.c | 25 | ||||
| -rw-r--r-- | Modules/socketmodule.c | 106 | 
11 files changed, 20 insertions, 228 deletions
diff --git a/Modules/_cryptmodule.c b/Modules/_cryptmodule.c index 51007889bf..62aa06cd85 100644 --- a/Modules/_cryptmodule.c +++ b/Modules/_cryptmodule.c @@ -5,19 +5,12 @@  #include <sys/types.h> -#ifdef __VMS -#include <openssl/des.h> -#endif -  /* Module crypt */  static PyObject *crypt_crypt(PyObject *self, PyObject *args)  {      char *word, *salt; -#ifndef __VMS -    extern char * crypt(const char *, const char *); -#endif      if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) {          return NULL; diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 79d292f1ae..cf0ac19976 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -208,11 +208,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)        return NULL;      }      Py_BEGIN_ALLOW_THREADS -#ifdef __VMS -    ret = ioctl(fd, code, (void *)arg); -#else      ret = ioctl(fd, code, arg); -#endif      Py_END_ALLOW_THREADS      if (ret < 0) {          PyErr_SetFromErrno(PyExc_IOError); diff --git a/Modules/fpectlmodule.c b/Modules/fpectlmodule.c index 6af2f82f70..052b83480d 100644 --- a/Modules/fpectlmodule.c +++ b/Modules/fpectlmodule.c @@ -70,10 +70,6 @@ extern "C" {  #if defined(__FreeBSD__)  #  include <ieeefp.h> -#elif defined(__VMS) -#define __NEW_STARLET -#include <starlet.h> -#include <ieeedef.h>  #endif  #ifndef WANT_SIGFPE_HANDLER @@ -182,23 +178,6 @@ static void fpe_reset(Sigfunc *handler)      ieee_set_fp_control(fp_control);      PyOS_setsig(SIGFPE, handler); -/*-- DEC ALPHA VMS --------------------------------------------------------*/ -#elif defined(__ALPHA) && defined(__VMS) -        IEEE clrmsk; -        IEEE setmsk; -        clrmsk.ieee$q_flags = -                IEEE$M_TRAP_ENABLE_UNF |  IEEE$M_TRAP_ENABLE_INE | -                 IEEE$M_MAP_UMZ; -        setmsk.ieee$q_flags = -                IEEE$M_TRAP_ENABLE_INV | IEEE$M_TRAP_ENABLE_DZE | -                IEEE$M_TRAP_ENABLE_OVF; -        sys$ieee_set_fp_control(&clrmsk, &setmsk, 0); -        PyOS_setsig(SIGFPE, handler); - -/*-- HP IA64 VMS --------------------------------------------------------*/ -#elif defined(__ia64) && defined(__VMS) -    PyOS_setsig(SIGFPE, handler); -  /*-- Cray Unicos ----------------------------------------------------------*/  #elif defined(cray)      /* UNICOS delivers SIGFPE by default, but no matherr */ @@ -251,14 +230,6 @@ static PyObject *turnoff_sigfpe(PyObject *self,PyObject *args)  #ifdef __FreeBSD__      fpresetsticky(fpgetsticky());      fpsetmask(0); -#elif defined(__VMS) -        IEEE clrmsk; -         clrmsk.ieee$q_flags = -                IEEE$M_TRAP_ENABLE_UNF |  IEEE$M_TRAP_ENABLE_INE | -                IEEE$M_MAP_UMZ | IEEE$M_TRAP_ENABLE_INV | -                IEEE$M_TRAP_ENABLE_DZE | IEEE$M_TRAP_ENABLE_OVF | -                IEEE$M_INHERIT; -        sys$ieee_set_fp_control(&clrmsk, 0, 0);  #else      fputs("Operation not implemented\n", stderr);  #endif diff --git a/Modules/getpath.c b/Modules/getpath.c index 9e79c26b9e..c057737ec2 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -110,11 +110,7 @@  #endif  #ifndef PREFIX -#  ifdef __VMS -#    define PREFIX "" -#  else -#    define PREFIX "/usr/local" -#  endif +#  define PREFIX "/usr/local"  #endif  #ifndef EXEC_PREFIX diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index a85a2715e9..c8a93723ea 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -58,17 +58,12 @@ mkgrent(struct group *p)  #define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)      SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name)); -#ifdef __VMS -    SET(setIndex++, Py_None); -    Py_INCREF(Py_None); -#else      if (p->gr_passwd)              SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));      else {              SET(setIndex++, Py_None);              Py_INCREF(Py_None);      } -#endif      SET(setIndex++, _PyLong_FromGid(p->gr_gid));      SET(setIndex++, w);  #undef SET diff --git a/Modules/main.c b/Modules/main.c index 9171070ab5..87a21d7c30 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -5,11 +5,6 @@  #include <locale.h> -#ifdef __VMS -#error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4" -#include <unixlib.h> -#endif -  #if defined(MS_WINDOWS) || defined(__CYGWIN__)  #include <windows.h>  #ifdef HAVE_FCNTL_H @@ -124,19 +119,7 @@ usage(int exitcode, wchar_t* program)          fprintf(f, usage_5, DELIM, PYTHONHOMEHELP);          fputs(usage_6, f);      } -#if defined(__VMS) -    if (exitcode == 0) { -        /* suppress 'error' message */ -        return 1; -    } -    else { -        /* STS$M_INHIB_MSG + SS$_ABORT */ -        return 0x1000002c; -    } -#else      return exitcode; -#endif -    /*NOTREACHED*/  }  static void RunStartupFile(PyCompilerFlags *cf) @@ -580,14 +563,7 @@ Py_Main(int argc, wchar_t **argv)      if (command == NULL && module == NULL && _PyOS_optind < argc &&          wcscmp(argv[_PyOS_optind], L"-") != 0)      { -#ifdef __VMS -        filename = decc$translate_vms(argv[_PyOS_optind]); -        if (filename == (char *)0 || filename == (char *)-1) -            filename = argv[_PyOS_optind]; - -#else          filename = argv[_PyOS_optind]; -#endif      }      stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); @@ -623,11 +599,6 @@ Py_Main(int argc, wchar_t **argv)  #endif /* !MS_WINDOWS */          /* Leave stderr alone - it should be unbuffered anyway. */      } -#ifdef __VMS -    else { -        setvbuf (stdout, (char *)NULL, _IOLBF, BUFSIZ); -    } -#endif /* __VMS */  #ifdef __APPLE__      /* On MacOS X, when the Python interpreter is embedded in an diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 366dac15e6..07b5c6bcd1 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -1158,12 +1158,6 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)          (void)fcntl(fd, F_FULLFSYNC);  #endif  #ifdef HAVE_FSTAT -#  ifdef __VMS -    /* on OpenVMS we must ensure that all bytes are written to the file */ -    if (fd != -1) { -        fsync(fd); -    } -#  endif      if (fd != -1 && fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) {          if (map_size == 0) {              if (st.st_size == 0) { diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ec70948e22..1258670e72 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -29,11 +29,6 @@  #include "posixmodule.h"  #endif -#if defined(__VMS) -#    error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4" -#    include <unixio.h> -#endif /* defined(__VMS) */ -  #ifdef __cplusplus  extern "C" {  #endif @@ -164,9 +159,6 @@ corresponding Unix manual entries for more information on calls.");  #define HAVE_FSYNC      1  #define fsync _commit  #else -#if defined(__VMS) -/* Everything needed is defined in vms/pyconfig.h */ -#else                   /* all other compilers */  /* Unix functions that the configure script doesn't check for */  #define HAVE_EXECV      1  #define HAVE_FORK       1 @@ -184,7 +176,6 @@ corresponding Unix manual entries for more information on calls.");  #define HAVE_SYSTEM     1  #define HAVE_WAIT       1  #define HAVE_TTYNAME    1 -#endif  /* __VMS */  #endif  /* _MSC_VER */  #endif  /* __BORLANDC__ */  #endif  /* ! __WATCOMC__ || __QNX__ */ @@ -2765,17 +2756,7 @@ os_ttyname_impl(PyModuleDef *module, int fd)  {      char *ret; -#if defined(__VMS) -    /* file descriptor 0 only, the default input device (stdin) */ -    if (fd == 0) { -        ret = ttyname(); -    } -    else { -        ret = NULL; -    } -#else      ret = ttyname(fd); -#endif      if (ret == NULL)          posix_error();      return ret; @@ -8340,10 +8321,6 @@ posix_fstat(PyObject *self, PyObject *args)      int res;      if (!PyArg_ParseTuple(args, "i:fstat", &fd))          return NULL; -#ifdef __VMS -    /* on OpenVMS we must ensure that all bytes are written to the file */ -    fsync(fd); -#endif      Py_BEGIN_ALLOW_THREADS      res = FSTAT(fd, &st);      Py_END_ALLOW_THREADS diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 9909400441..ebb8712018 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -69,18 +69,10 @@ mkpwent(struct passwd *p)  #define SETS(i,val) sets(v, i, val)      SETS(setIndex++, p->pw_name); -#ifdef __VMS -    SETS(setIndex++, ""); -#else      SETS(setIndex++, p->pw_passwd); -#endif      PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid));      PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid)); -#ifdef __VMS -    SETS(setIndex++, ""); -#else      SETS(setIndex++, p->pw_gecos); -#endif      SETS(setIndex++, p->pw_dir);      SETS(setIndex++, p->pw_shell); diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 0293c8b47b..d44e8de929 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -52,9 +52,6 @@ extern void bzero(void *, int);  #  include <winsock.h>  #else  #  define SOCKET int -#  if defined(__VMS) -#    include <socket.h> -#  endif  #endif  /* list of Python objects and their file descriptor */ @@ -1708,17 +1705,17 @@ static PyTypeObject kqueue_queue_Type;   * kevent is not standard and its members vary across BSDs.   */  #if !defined(__OpenBSD__) -#   define IDENT_TYPE	T_UINTPTRT -#   define IDENT_CAST	Py_intptr_t -#   define DATA_TYPE	T_INTPTRT +#   define IDENT_TYPE  T_UINTPTRT +#   define IDENT_CAST  Py_intptr_t +#   define DATA_TYPE   T_INTPTRT  #   define DATA_FMT_UNIT INTPTRT_FMT_UNIT -#   define IDENT_AsType	PyLong_AsUintptr_t +#   define IDENT_AsType PyLong_AsUintptr_t  #else -#   define IDENT_TYPE	T_UINT -#   define IDENT_CAST	int -#   define DATA_TYPE	T_INT +#   define IDENT_TYPE  T_UINT +#   define IDENT_CAST  int +#   define DATA_TYPE   T_INT  #   define DATA_FMT_UNIT "i" -#   define IDENT_AsType	PyLong_AsUnsignedLong +#   define IDENT_AsType PyLong_AsUnsignedLong  #endif  /* Unfortunately, we can't store python objects in udata, because @@ -1770,7 +1767,7 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)      if (PyLong_Check(pfd)  #if IDENT_TYPE == T_UINT -	&& PyLong_AsUnsignedLong(pfd) <= UINT_MAX +        && PyLong_AsUnsignedLong(pfd) <= UINT_MAX  #endif      ) {          self->e.ident = IDENT_AsType(pfd); @@ -2253,7 +2250,7 @@ arguments; each contains the subset of the corresponding file descriptors\n\  that are ready.\n\  \n\  *** IMPORTANT NOTICE ***\n\ -On Windows and OpenVMS, only sockets are supported; on Unix, all file\n\ +On Windows only sockets are supported; on Unix, all file\n\  descriptors can be used.");  static PyMethodDef select_methods[] = { @@ -2271,7 +2268,7 @@ PyDoc_STRVAR(module_doc,  "This module supports asynchronous I/O on multiple file descriptors.\n\  \n\  *** IMPORTANT NOTICE ***\n\ -On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors."); +On Windows only sockets are supported; on Unix, all file descriptors.");  static struct PyModuleDef selectmodule = { diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 92d52d11ce..0aba5911e2 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -188,7 +188,7 @@ if_indextoname(index) -- return the corresponding interface name\n\  #if defined(WITH_THREAD) && (defined(__APPLE__) || \      (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \      defined(__OpenBSD__) || defined(__NetBSD__) || \ -    defined(__VMS) || !defined(HAVE_GETADDRINFO)) +    !defined(HAVE_GETADDRINFO))  #define USE_GETADDRINFO_LOCK  #endif @@ -212,10 +212,6 @@ if_indextoname(index) -- return the corresponding interface name\n\  # include <ctype.h>  #endif -#if defined(__VMS) -#  include <ioctl.h> -#endif -  #ifdef __APPLE__  # include <sys/ioctl.h>  #endif @@ -403,11 +399,6 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);  #endif  #endif -#ifdef __VMS -/* TCP/IP Services for VMS uses a maximum send/recv buffer length */ -#define SEGMENT_SIZE (32 * 1024 -1) -#endif -  /* Convert "sock_addr_t *" to "struct sockaddr *". */  #define SAS2SA(x)       (&((x)->sa)) @@ -556,37 +547,13 @@ set_gaierror(int error)      return NULL;  } -#ifdef __VMS -/* Function to send in segments */ -static int -sendsegmented(int sock_fd, char *buf, int len, int flags) -{ -    int n = 0; -    int remaining = len; - -    while (remaining > 0) { -        unsigned int segment; - -        segment = (remaining >= SEGMENT_SIZE ? SEGMENT_SIZE : remaining); -        n = send(sock_fd, buf, segment, flags); -        if (n < 0) { -            return n; -        } -        remaining -= segment; -        buf += segment; -    } /* end while */ - -    return len; -} -#endif -  /* Function to perform the setting of socket blocking mode     internally. block = (1 | 0). */  static int  internal_setblocking(PySocketSockObject *s, int block)  {  #if !defined(MS_WINDOWS) \ -    && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) || defined(__VMS)) +    && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)))      int delay_flag, new_delay_flag;  #endif  #ifdef SOCK_NONBLOCK @@ -598,7 +565,7 @@ internal_setblocking(PySocketSockObject *s, int block)      Py_BEGIN_ALLOW_THREADS  #ifndef MS_WINDOWS -#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) || defined(__VMS) +#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO))      block = !block;      ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block);  #else @@ -2227,13 +2194,7 @@ sock_getsockopt(PySocketSockObject *s, PyObject *args)              return s->errorhandler();          return PyLong_FromLong(flag);      } -#ifdef __VMS -    /* socklen_t is unsigned so no negative test is needed, -       test buflen == 0 is previously done */ -    if (buflen > 1024) { -#else      if (buflen <= 0 || buflen > 1024) { -#endif          PyErr_SetString(PyExc_OSError,                          "getsockopt buflen out of range");          return NULL; @@ -2603,10 +2564,6 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)  {      Py_ssize_t outlen = -1;      int timeout; -#ifdef __VMS -    int remaining; -    char *read_buf; -#endif      if (!IS_SELECTABLE(s)) {          select_error(); @@ -2617,7 +2574,6 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)          return 0;      } -#ifndef __VMS      BEGIN_SELECT_LOOP(s)      Py_BEGIN_ALLOW_THREADS      timeout = internal_select_ex(s, 0, interval); @@ -2643,48 +2599,6 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)          s->errorhandler();          return -1;      } -#else -    read_buf = cbuf; -    remaining = len; -    while (remaining != 0) { -        unsigned int segment; -        int nread = -1; - -        segment = remaining /SEGMENT_SIZE; -        if (segment != 0) { -            segment = SEGMENT_SIZE; -        } -        else { -            segment = remaining; -        } - -        BEGIN_SELECT_LOOP(s) -        Py_BEGIN_ALLOW_THREADS -        timeout = internal_select_ex(s, 0, interval); -        if (!timeout) -            nread = recv(s->sock_fd, read_buf, segment, flags); -        Py_END_ALLOW_THREADS -        if (timeout == 1) { -            PyErr_SetString(socket_timeout, "timed out"); -            return -1; -        } -        END_SELECT_LOOP(s) - -        if (nread < 0) { -            s->errorhandler(); -            return -1; -        } -        if (nread != remaining) { -            read_buf += nread; -            break; -        } - -        remaining -= segment; -        read_buf += segment; -    } -    outlen = read_buf - cbuf; -#endif /* !__VMS */ -      return outlen;  } @@ -3318,9 +3232,7 @@ sock_send(PySocketSockObject *s, PyObject *args)      Py_BEGIN_ALLOW_THREADS      timeout = internal_select_ex(s, 1, interval);      if (!timeout) { -#ifdef __VMS -        n = sendsegmented(s->sock_fd, buf, len, flags); -#elif defined(MS_WINDOWS) +#ifdef MS_WINDOWS          if (len > INT_MAX)              len = INT_MAX;          n = send(s->sock_fd, buf, (int)len, flags); @@ -3375,9 +3287,7 @@ sock_sendall(PySocketSockObject *s, PyObject *args)          timeout = internal_select(s, 1);          n = -1;          if (!timeout) { -#ifdef __VMS -            n = sendsegmented(s->sock_fd, buf, len, flags); -#elif defined(MS_WINDOWS) +#ifdef MS_WINDOWS              if (len > INT_MAX)                  len = INT_MAX;              n = send(s->sock_fd, buf, (int)len, flags); @@ -5310,9 +5220,9 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)  #if defined(__APPLE__) && defined(AI_NUMERICSERV)      if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) {          /* On OSX upto at least OSX 10.8 getaddrinfo crashes -	 * if AI_NUMERICSERV is set and the servname is NULL or "0". -	 * This workaround avoids a segfault in libsystem. -	 */ +         * if AI_NUMERICSERV is set and the servname is NULL or "0". +         * This workaround avoids a segfault in libsystem. +         */          pptr = "00";      }  #endif  | 
