[unixODBC-dev] Right way to read odbc.ini file.
nick at easysoft.com
Fri Sep 10 14:44:30 BST 2004
Martin J. Evans wrote:
> I could be wrong and Nick might remember but I think DontDLClose attribute was
> invented because of some drivers use of atexit or _fini - Nick?
> <snipped test code>
Yes, this test code demonstrated perfectly the reason dontdlclose was
added. Drivers registered atexit functions, and the atexit list was
maintained in the process. then after the driver manager had done a
dlclose (releasing the driver code from the processes memory), the
atexit function was being called on process termination, resulting in a
seg fault due to attempting to execute code outside the programs code
It may be if you have a version that doesn't do this, that someone has
decided to fix this problem in the libc, making atexit know about
dynamic loading. But its certainly not portable.
I dislike the global that the ini cacheing requires, but I can't see a
simple way out. The ini cacheing can be disabled at build time though.
More information about the unixODBC-dev