summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-07-18 16:17:16 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-07-18 16:17:16 (GMT)
commitf0473d511b7f883bfff3048f55e3a6adc7a43cb9 (patch)
tree8239a8d19fe2851555ff96b250cad6e24760717d /Python/pystate.c
parent984158d25bd76fa33d4245e98f53c876f428d5f4 (diff)
downloadcpython-f0473d511b7f883bfff3048f55e3a6adc7a43cb9.zip
cpython-f0473d511b7f883bfff3048f55e3a6adc7a43cb9.tar.gz
cpython-f0473d511b7f883bfff3048f55e3a6adc7a43cb9.tar.bz2
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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index cca1e7c..2f15fdf 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;