From owner-freebsd-hackers Sun Feb 4 12:28:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 7365737B401 for ; Sun, 4 Feb 2001 12:28:37 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id f14KSGD16125; Sun, 4 Feb 2001 12:28:16 -0800 (PST) (envelope-from dillon) Date: Sun, 4 Feb 2001 12:28:16 -0800 (PST) From: Matt Dillon Message-Id: <200102042028.f14KSGD16125@earth.backplane.com> To: Brian McGovern Cc: hackers@FreeBSD.ORG Subject: Re: exit() does not do dlclose()? References: <200102041654.f14Gsh808001@spoon.beta.com> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :I'm playing with an application that uses dlopen() to load some libraries. I :use the _init function to set the libraries up. I've also set up the _fini :functions to shut things down. : :I see, in the man page, that dlclose() will unload the libraries and call :_fini. : :My question is whether or not exit() does the same thing? It currently does :not appear to, although that would seem rather odd to me, given the other :types of cleanup it does. : :Is this due to the fact that dlopen() bypasses the 'normal' loader, and :therefore the cleanup routines can not understand how to get rid of them :correctly? : : -Brian What happens if the exit code needs information stored in the library it is trying to close? For example, like atexit() code? If a program is exiting, there is no real need to close any loaded libraries since they will be wiped when the VM context goes away. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message