Re: [exim-dev] dlopen cleanup

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: David Saez Padros
Fecha:  
A: Tony Finch
Cc: exim-dev
Asunto: Re: [exim-dev] dlopen cleanup
Hi !!

>> Just for the whishlist, it may be interesting to implement a
>> 'cleanup' routine for dynamically-loaded objects so when exim
>> shutdown it will try to call a predefined function in each
>> dynamically-loaded object (i.e. exim_dl_cleanup) that gives
>> any dynamically-loaded object the chance to do it's own cleanup
>
> This functionality is built-in to the dynamic linker as part of its
> support for C++ static constructors and destructors. You can make use of
> this functionality with GCC's C extensions by using the destructor
> attribute on your cleanup function's declaration. For example:
>
> static void cleanup(void) __attribute__((destructor));


I'm not using C++ but looks like it can work in plain C , anyway it
will be safe to call exim's functions (debug_printf, log_write, ...)
from within such a cleanup function ?

--
Thanx & best regards ...

----------------------------------------------------------------
    David Saez Padros                http://www.ols.es
    On-Line Services 2000 S.L.       e-mail  david@???
    Pintor Vayreda 1                 telf    +34 902 50 29 75
    08184 Palau-Solita i Plegamans   movil   +34 670 35 27 53
----------------------------------------------------------------