* Ami Chayun <[EMAIL PROTECTED]> [061114 16:48]: > Hi all, > I have a shared library, and I want a specific function to be called once the > library is loaded. > > Dlls has the notorious DllMain function. Is there a method of achieving the > same in an .so file?
Check the document at http://people.redhat.com/drepper/dsohowto.pdf it is titled "How To Write Shared Libraries" and check section 1.5.6 on "Running the Constructors". void __attribute((constructor)) my_init_func(void) { } Is what you want, but you should be reading that text anyhow to better understand shared libraries and how to write them. Baruch ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
