mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #16136: Remove VMS support and VMS-related code
This commit is contained in:
parent
5255b86fba
commit
af01f66817
20 changed files with 27 additions and 325 deletions
|
@ -36,25 +36,16 @@ const char *_PyImport_DynLoadFiletab[] = {
|
|||
#ifdef __CYGWIN__
|
||||
".dll",
|
||||
#else /* !__CYGWIN__ */
|
||||
#ifdef __VMS
|
||||
".exe",
|
||||
".EXE",
|
||||
#else /* !__VMS */
|
||||
"." SOABI ".so",
|
||||
".abi" PYTHON_ABI_STRING ".so",
|
||||
".so",
|
||||
#endif /* __VMS */
|
||||
#endif /* __CYGWIN__ */
|
||||
NULL,
|
||||
};
|
||||
|
||||
static struct {
|
||||
dev_t dev;
|
||||
#ifdef __VMS
|
||||
ino_t ino[3];
|
||||
#else
|
||||
ino_t ino;
|
||||
#endif
|
||||
void *handle;
|
||||
} handles[128];
|
||||
static int nhandles = 0;
|
||||
|
@ -95,29 +86,12 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
|
|||
}
|
||||
if (nhandles < 128) {
|
||||
handles[nhandles].dev = statb.st_dev;
|
||||
#ifdef __VMS
|
||||
handles[nhandles].ino[0] = statb.st_ino[0];
|
||||
handles[nhandles].ino[1] = statb.st_ino[1];
|
||||
handles[nhandles].ino[2] = statb.st_ino[2];
|
||||
#else
|
||||
handles[nhandles].ino = statb.st_ino;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
dlopenflags = PyThreadState_GET()->interp->dlopenflags;
|
||||
|
||||
#ifdef __VMS
|
||||
/* VMS currently don't allow a pathname, use a logical name instead */
|
||||
/* Concatenate 'python_module_' and shortname */
|
||||
/* so "import vms.bar" will use the logical python_module_bar */
|
||||
/* As C module use only one name space this is probably not a */
|
||||
/* important limitation */
|
||||
PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s",
|
||||
shortname);
|
||||
pathname = pathbuf;
|
||||
#endif
|
||||
|
||||
handle = dlopen(pathname, dlopenflags);
|
||||
|
||||
if (handle == NULL) {
|
||||
|
|
|
@ -68,28 +68,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
|
|||
#endif /* MS_WINDOWS */
|
||||
|
||||
|
||||
#ifdef __VMS
|
||||
/* Use openssl random routine */
|
||||
#include <openssl/rand.h>
|
||||
static int
|
||||
vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
|
||||
{
|
||||
if (RAND_pseudo_bytes(buffer, size) < 0) {
|
||||
if (raise) {
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"RAND_pseudo_bytes");
|
||||
} else {
|
||||
Py_FatalError("Failed to initialize the randomized hash "
|
||||
"secret using RAND_pseudo_bytes");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* __VMS */
|
||||
|
||||
|
||||
#if !defined(MS_WINDOWS) && !defined(__VMS)
|
||||
#ifndef MS_WINDOWS
|
||||
static int urandom_fd = -1;
|
||||
|
||||
/* Read size bytes from /dev/urandom into buffer.
|
||||
|
@ -195,7 +174,7 @@ dev_urandom_close(void)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* !defined(MS_WINDOWS) && !defined(__VMS) */
|
||||
#endif /* MS_WINDOWS */
|
||||
|
||||
/* Fill buffer with pseudo-random bytes generated by a linear congruent
|
||||
generator (LCG):
|
||||
|
@ -237,11 +216,7 @@ _PyOS_URandom(void *buffer, Py_ssize_t size)
|
|||
#ifdef MS_WINDOWS
|
||||
return win32_urandom((unsigned char *)buffer, size, 1);
|
||||
#else
|
||||
# ifdef __VMS
|
||||
return vms_urandom((unsigned char *)buffer, size, 1);
|
||||
# else
|
||||
return dev_urandom_python((char*)buffer, size);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -285,12 +260,8 @@ _PyRandom_Init(void)
|
|||
else {
|
||||
#ifdef MS_WINDOWS
|
||||
(void)win32_urandom(secret, secret_size, 0);
|
||||
#else /* #ifdef MS_WINDOWS */
|
||||
# ifdef __VMS
|
||||
vms_urandom(secret, secret_size, 0);
|
||||
# else
|
||||
#else
|
||||
dev_urandom_noraise(secret, secret_size);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -298,7 +269,7 @@ _PyRandom_Init(void)
|
|||
void
|
||||
_PyRandom_Fini(void)
|
||||
{
|
||||
#if !defined(MS_WINDOWS) && !defined(__VMS)
|
||||
#ifndef MS_WINDOWS
|
||||
dev_urandom_close();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -32,10 +32,6 @@ extern void *PyWin_DLLhModule;
|
|||
extern const char *PyWin_DLLVersionString;
|
||||
#endif
|
||||
|
||||
#ifdef __VMS
|
||||
#include <unixlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
#include <locale.h>
|
||||
#include <langinfo.h>
|
||||
|
@ -1867,22 +1863,7 @@ makeargvobject(int argc, wchar_t **argv)
|
|||
if (av != NULL) {
|
||||
int i;
|
||||
for (i = 0; i < argc; i++) {
|
||||
#ifdef __VMS
|
||||
PyObject *v;
|
||||
|
||||
/* argv[0] is the script pathname if known */
|
||||
if (i == 0) {
|
||||
char* fn = decc$translate_vms(argv[0]);
|
||||
if ((fn == (char *)0) || fn == (char *)-1)
|
||||
v = PyUnicode_FromString(argv[0]);
|
||||
else
|
||||
v = PyUnicode_FromString(
|
||||
decc$translate_vms(argv[0]));
|
||||
} else
|
||||
v = PyUnicode_FromString(argv[i]);
|
||||
#else
|
||||
PyObject *v = PyUnicode_FromWideChar(argv[i], -1);
|
||||
#endif
|
||||
if (v == NULL) {
|
||||
Py_DECREF(av);
|
||||
av = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue