Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 82023 invoked by uid 500); 10 Apr 2001 03:07:11 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 82010 invoked from network); 10 Apr 2001 03:07:10 -0000 Date: Mon, 9 Apr 2001 20:08:59 -0700 (PDT) From: X-Sender: To: Doug MacEachern Cc: Subject: Re: apr_dso_handle_close ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N How is this different from apr_dso_unload? Ryan On Mon, 9 Apr 2001, Doug MacEachern wrote: > mod_perl needs to close the handle for each Perl extension .so loaded by > Perl modules. in 1.x we could call: > ap_os_dso_unload(handle); > > where handle is the same value returned by dlopen() or similar. > Perl's abstraction is not an option since you need to call a Perl function > to use it, and we cannot close these handles until the interpreter is > destroyed. > > something like the following for each $os/dso.c would do the trick. > i will implement the patch if there are no objections, otherwise it will > really suck to duplicate this functionality that is currently private in > apr. > > Index: srclib/apr/dso/unix/dso.c > =================================================================== > RCS file: /home/cvs/apr/dso/unix/dso.c,v > retrieving revision 1.33 > diff -u -r1.33 dso.c > --- srclib/apr/dso/unix/dso.c 2001/02/16 21:04:17 1.33 > +++ srclib/apr/dso/unix/dso.c 2001/04/10 00:08:52 > @@ -64,19 +64,30 @@ > #include /* for strerror() on HP-UX */ > #endif > > +APR_DECLARE(apr_status_t) apr_dso_handle_close(void *handle) > +{ > +#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) > + shl_unload((shl_t)dso->handle); > +#else > + if (dlclose(handle) != 0) { > + return APR_EINIT; > + } > +#endif > + return APR_SUCCESS; > +} > + > static apr_status_t dso_cleanup(void *thedso) > { > + apr_status_t status; > apr_dso_handle_t *dso = thedso; > > if (dso->handle == NULL) > return APR_SUCCESS; > > -#if defined(HPUX) || defined(HPUX10) || defined(HPUX11) > - shl_unload((shl_t)dso->handle); > -#else > - if (dlclose(dso->handle) != 0) > - return APR_EINIT; > -#endif > + if ((status = apr_dso_handle_close(dso->handle)) != APR_SUCCESS) { > + return status; > + } > + > dso->handle = NULL; > > return APR_SUCCESS; > > _______________________________________________________________________________ Ryan Bloom rbb@apache.org 406 29th St. San Francisco, CA 94131 -------------------------------------------------------------------------------