Subject: C shared lib question
To: None <current-users@netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: current-users
Date: 03/08/2000 21:59:10
I'm porting the ODBC driver for PostgreSQL to NetBSD, but I'm having
the following problem.  The code currently defines two functions _init
and _fini to call "constructor" and "destructor" code for the shared
object:

BOOL _init (void)
{
	getGlobalDefaults(DBMS_NAME, ODBCINST_INI, FALSE);
	return TRUE;
}

Is there a more portable C construct to ensure that a function is
called when a shared library is loaded, much like a global static C++
object's constructor?

     -- Johnny C. Lam <lamj@stat.cmu.edu>
        Department of Statistics, Carnegie Mellon University
        http://www.stat.cmu.edu/~lamj/