X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FDynaLoader%2Fdl_hpux.xs;h=583cfc270cb847ec06950584eb46a9553b2c1da7;hb=5f320ac74440f7b17e30890d0ed2c920d7301549;hp=8fd6348c933619c1451f7bc85392cf488b73970c;hpb=cdc73a103e56840003cb817a381323974e4b9832;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/DynaLoader/dl_hpux.xs b/ext/DynaLoader/dl_hpux.xs index 8fd6348..583cfc2 100644 --- a/ext/DynaLoader/dl_hpux.xs +++ b/ext/DynaLoader/dl_hpux.xs @@ -58,8 +58,8 @@ dl_load_file(filename, flags=0) PREINIT: shl_t obj = NULL; int i, max, bind_type; - CODE: dMY_CXT; + CODE: DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_load_file(%s,%x):\n", filename,flags)); if (flags & 0x01) Perl_warn(aTHX_ "Can't make loaded symbols global on this platform while loading %s",filename); @@ -102,6 +102,19 @@ end: sv_setiv( ST(0), PTR2IV(obj) ); +int +dl_unload_file(libref) + void * libref + CODE: + DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dl_unload_file(%lx):\n", PTR2ul(libref))); + RETVAL = (shl_unload(libref) == 0 ? 1 : 0); + if (!RETVAL) + SaveError(aTHX_ "%s", Strerror(errno)); + DLDEBUG(2,PerlIO_printf(Perl_debug_log, " retval = %d\n", RETVAL)); + OUTPUT: + RETVAL + + void * dl_find_symbol(libhandle, symbolname) void * libhandle @@ -147,14 +160,14 @@ void dl_install_xsub(perl_name, symref, filename="$Package") char * perl_name void * symref - char * filename + const char * filename CODE: DLDEBUG(2,PerlIO_printf(Perl_debug_log, "dl_install_xsub(name=%s, symref=%x)\n", perl_name, symref)); - ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name, - (void(*)(pTHX_ CV *))symref, - filename))); - + ST(0) = sv_2mortal(newRV((SV*)newXS_flags(perl_name, + (void(*)(pTHX_ CV *))symref, + filename, NULL, + XS_DYNAMIC_FILENAME))); char * dl_error() @@ -164,4 +177,20 @@ dl_error() OUTPUT: RETVAL +#if defined(USE_ITHREADS) + +void +CLONE(...) + CODE: + MY_CXT_CLONE; + + /* MY_CXT_CLONE just does a memcpy on the whole structure, so to avoid + * using Perl variables that belong to another thread, we create our + * own for this thread. + */ + MY_CXT.x_dl_last_error = newSVpvn("", 0); + dl_resolve_using = get_av("DynaLoader::dl_resolve_using", GV_ADDMULTI); + +#endif + # end.