Mercurial > cpython-lru_cache-weakref
diff Python/pystate.c @ 18689:064de84385ca legacy-trunk
Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags.
Add dlopenflags to PyInterpreterState, and use it in dlopen calls.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Wed, 18 Jul 2001 16:17:16 +0000 |
| parents | 3b295ce2705f |
| children | b0329649b8cf |
line wrap: on
line diff
--- a/Python/pystate.c Wed Jul 18 15:30:25 2001 +0000 +++ b/Python/pystate.c Wed Jul 18 16:17:16 2001 +0000 @@ -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 @@ 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;
