diff options
| author | Martin v. Löwis <martin@v.loewis.de> | 2001-07-18 16:17:16 +0000 |
|---|---|---|
| committer | Martin v. Löwis <martin@v.loewis.de> | 2001-07-18 16:17:16 +0000 |
| commit | 8844f8cf00b503f45dcd28086515d540bb861ac0 (patch) | |
| tree | ea20a73bce37559d4e24b3af1d4cbee2e42d384a /Python/pystate.c | |
| parent | f4cf190623bf4e1b4a81a3ab05c395bca82d9b29 (diff) | |
| download | cpython-8844f8cf00b503f45dcd28086515d540bb861ac0.tar.gz | |
Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags.
Add dlopenflags to PyInterpreterState, and use it in dlopen calls.
Diffstat (limited to 'Python/pystate.c')
| -rw-r--r-- | Python/pystate.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index cca1e7cdbe..2f15fdfe94 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -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; |
