Trigger function on shared module init - Linux

This is a discussion on Trigger function on shared module init - Linux ; Hi, I need to trigger a function, whenever my shared module (.so) gets loaded and before its been used by application. Any suggestions? Thanks Rayuthar...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Trigger function on shared module init

  1. Trigger function on shared module init

    Hi,

    I need to trigger a function, whenever my shared module (.so) gets
    loaded and before its been used by application.

    Any suggestions?

    Thanks
    Rayuthar

  2. Re: Trigger function on shared module init

    rayuthar@gmail.com writes:

    > I need to trigger a function, whenever my shared module (.so) gets
    > loaded and before its been used by application.


    You are looking for a library initializer.

    Do "info gcc" -> "C extensions" -> "Function Attributes"
    and look for 'constructor' attribute.

    Cheers,
    --
    In order to understand recursion you must first understand recursion.
    Remove /-nsp/ for email.

+ Reply to Thread