dougm       2002/06/20 17:05:17

  Added:       src/modules/perl modperl_sys.c modperl_sys.h
  Log:
  rolling our own modperl_sys_dlclose() to avoid apr/pool overhead/thread issues
  
  Revision  Changes    Path
  1.1                  modperl-2.0/src/modules/perl/modperl_sys.c
  
  Index: modperl_sys.c
  ===================================================================
  #include "mod_perl.h"
  
  /*
   * Perl does not provide this abstraction.
   * APR does, but requires a pool.  efforts to expose this area of apr
   * failed.  so we roll our own.  *sigh*
   */
  int modperl_sys_dlclose(void *handle)
  {
  #if defined(MP_SYS_DL_DLOPEN)
  #ifdef I_DLFCN
  #include <dlfcn.h>
  #else
  #include <nlist.h>
  #include <link.h>
  #endif
      return dlclose(handle) == 0;
  #elif defined(MP_SYS_DL_DYLD)
      return NSUnlinkModule(handle, FALSE);
  #elif defined(MP_SYS_DL_HPUX)
      shl_unload((shl_t)handle);
      return 1;
  #elif defined(MP_SYS_DL_WIN32)
      return FreeLibrary(handle);
  #elif defined(MP_SYS_DL_BEOS)
      return unload_add_on(handle) < B_NO_ERROR;
  #elif defined(MP_SYS_DL_DLLLOAD)
      return dllfree(handle) == 0;
  #elif defined(MP_SYS_DL_AIX)
      return dlclose(handle) == 0;
  #else
  #error "modperl_sys_dlclose not defined on this platform"
      return 0;
  #endif
  }
  
  
  
  1.1                  modperl-2.0/src/modules/perl/modperl_sys.h
  
  Index: modperl_sys.h
  ===================================================================
  #ifndef MODPERL_SYS_H
  #define MODPERL_SYS_H
  
  /*
   * system specific type stuff.
   * hopefully won't be much here since Perl/APR/Apache
   * take care of most portablity issues.
   */
  int modperl_sys_dlclose(void *handle);
  
  #endif /* MODPERL_SYS_H */
  
  
  


Reply via email to