From f0473d511b7f883bfff3048f55e3a6adc7a43cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Wed, 18 Jul 2001 16:17:16 +0000 Subject: Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags. Add dlopenflags to PyInterpreterState, and use it in dlopen calls. --- Python/pystate.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Python/pystate.c') 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 +#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; -- cgit v1.2.1