diff options
-rw-r--r-- | NEWS | 13 | ||||
-rw-r--r-- | libguile/dynl-dl.c | 6 | ||||
-rw-r--r-- | libguile/dynl-dld.c | 3 | ||||
-rw-r--r-- | libguile/dynl-shl.c | 3 | ||||
-rw-r--r-- | libguile/dynl.h | 2 |
5 files changed, 22 insertions, 5 deletions
@@ -46,6 +46,19 @@ in backtraces. * Changes to Scheme functions and syntax +** The function `dynamic-link' now takes optional keyword arguments. + The only keyword argument that is currently defined is `:global + BOOL'. With it, you can control whether the shared library will be + linked in global mode or not. In global mode, the symbols from the + linked library can be used to resolve references from other + dynamically linked libraries. In non-global mode, the linked + library is essentially invisible and can only be accessed via + `dynamic-func', etc. The default is now to link in global mode. + Previously, the default has been non-global mode. + + The `#:global' keyword is only effective on platforms that support + the dlopen family of functions. + ** New function `provided?' - Function: provided? FEATURE diff --git a/libguile/dynl-dl.c b/libguile/dynl-dl.c index 13401e23b..8522002d8 100644 --- a/libguile/dynl-dl.c +++ b/libguile/dynl-dl.c @@ -54,11 +54,13 @@ #endif static void * -sysdep_dynl_link (fname, subr) +sysdep_dynl_link (fname, flags, subr) const char *fname; + int flags; const char *subr; { - void *handle = dlopen (fname, DLOPEN_MODE); + void *handle = dlopen (fname, (DLOPEN_MODE + | (flags & DYNL_GLOBAL)? RTLD_GLOBAL : 0)); if (NULL == handle) { SCM_ALLOW_INTS; diff --git a/libguile/dynl-dld.c b/libguile/dynl-dld.c index eef786ffd..f3c24c2b5 100644 --- a/libguile/dynl-dld.c +++ b/libguile/dynl-dld.c @@ -64,8 +64,9 @@ listundefs () } static void * -sysdep_dynl_link (fname, subr) +sysdep_dynl_link (fname, int flags, subr) const char *fname; + int flags; const char *subr; { int status; diff --git a/libguile/dynl-shl.c b/libguile/dynl-shl.c index 385a8677c..8f0caf2d6 100644 --- a/libguile/dynl-shl.c +++ b/libguile/dynl-shl.c @@ -50,8 +50,9 @@ #include <string.h> static void * -sysdep_dynl_link (fname, subr) +sysdep_dynl_link (fname, flags, subr) const char *fname; + int flags; const char *subr; { shl_t shl; diff --git a/libguile/dynl.h b/libguile/dynl.h index 3b0d37fcc..bca388e2c 100644 --- a/libguile/dynl.h +++ b/libguile/dynl.h @@ -51,7 +51,7 @@ void scm_register_module_xxx SCM_P ((char *module_name, void *init_func)); SCM scm_registered_modules SCM_P ((void)); SCM scm_clear_registered_modules SCM_P ((void)); -SCM scm_dynamic_link SCM_P ((SCM fname)); +SCM scm_dynamic_link SCM_P ((SCM fname, SCM rest)); SCM scm_dynamic_unlink SCM_P ((SCM dobj)); SCM scm_dynamic_object_p SCM_P ((SCM obj)); SCM scm_dynamic_func SCM_P ((SCM symb, SCM dobj)); |