This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: shared lib exit function
Hi Martin,
It works, thanks a lot.
calle
Wed, Nov 03, 1999 at 08:42:44PM +0100, Martin v. Loewis schrieb:
> > #define __exit __attribute__ ((__section__ (".fini")))
> >
> > static void __exit exitfunc(void)
> > {
> > if (capi_fd >= 0) {
> > close(capi_fd);
> > capi_fd = -1;
> > }
> > }
>
> Hi Carsten,
>
> Did you try
>
> static void exitfunc(void) __attribute__((destructor));
>
> static void exitfunc(void)
> {
> if (capi_fd >= 0) {
> close(capi_fd);
> capi_fd = -1;
> }
> }
>
> Hope this helps,
> Martin