1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

* dynl.c (scm_dynamic_call, scm_dynamic_args_call): Wrap dynamic

function call in SCM_DEFER_INTS/SCM_ALLOW_INTS.
(scm_dynamic_link, scm_dynamic_unlink, scm_dynamic_func): Always
call the sysdep functions with deferred ints.
* dynl.c, dynl-dl.c, dynl-dld.c, dynl-shl.c (sysdep_dynl_link,
sysdep_dynl_unlink, sysdep_dynl_func): Expect to be called with
deferred interrupts and insert SCM_ALLOW_INTS before throwing an
error.

* dynl.c (scm_dynamic_unlink, scm_dynamic_call): Return
SCM_UNSPECIFIED.
This commit is contained in:
Marius Vollmer 1997-06-16 19:09:11 +00:00
parent cc0b331281
commit 419e9e117f
4 changed files with 49 additions and 28 deletions

View file

@ -61,7 +61,10 @@ sysdep_dynl_link (fname, subr)
BIND_TOGETHER ||
BIND_VERBOSE || DYNAMIC_PATH, 0L);
if (NULL==shl)
{
SCM_ALLOW_INTS;
scm_misc_error (subr, "dynamic linking failed", SCM_EOL);
}
return shl;
}
@ -70,13 +73,11 @@ sysdep_dynl_unlink (handle, subr)
void *handle;
char *subr;
{
int status;
SCM_DEFER_INTS;
status = shl_unload ((shl_t) handle);
SCM_ALLOW_INTS;
if (status)
scm_misc_error (subr, "dynamic unlinking failed", SCM_EOL);
if (shl_unload ((shl_t) handle))
{
SCM_ALLOW_INTS;
scm_misc_error (subr, "dynamic unlinking failed", SCM_EOL);
}
}
static void *
@ -87,13 +88,15 @@ sysdep_dynl_func (symb, handle, subr)
{
int status, i;
struct shl_symbol *sym;
SCM_DEFER_INTS;
status = shl_getsymbols((shl_t) handle, TYPE_PROCEDURE,
EXPORT_SYMBOLS, malloc, &sym);
SCM_ALLOW_INTS;
for (i=0; i<status; ++i) {
if (strcmp(symb, sym[i].name) == 0) return sym[i].value;
}
SCM_ALLOW_INTS;
scm_misc_error (subr, "undefined function",
scm_cons (scm_makfrom0str (symb), SCM_EOL));
}