mirror of
https://github.com/python/cpython.git
synced 2025-09-06 17:02:26 +00:00
Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags.
Add dlopenflags to PyInterpreterState, and use it in dlopen calls.
This commit is contained in:
parent
984158d25b
commit
f0473d511b
6 changed files with 103 additions and 13 deletions
|
@ -3,6 +3,16 @@
|
|||
|
||||
#include "Python.h"
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#ifndef RTLD_LAZY
|
||||
#define RTLD_LAZY 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define ZAP(x) { \
|
||||
PyObject *tmp = (PyObject *)(x); \
|
||||
(x) = NULL; \
|
||||
|
@ -39,6 +49,13 @@ PyInterpreterState_New(void)
|
|||
interp->builtins = NULL;
|
||||
interp->checkinterval = 10;
|
||||
interp->tstate_head = NULL;
|
||||
#ifdef HAVE_DLOPEN
|
||||
#ifdef RTLD_NOW
|
||||
interp->dlopenflags = RTLD_NOW;
|
||||
#else
|
||||
interp->dlopenflags = RTLD_LAZY;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
HEAD_LOCK();
|
||||
interp->next = interp_head;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue