Trigger function on shared module init

Discussion in 'C Programming' started by rayuthar@gmail.com, Apr 17, 2008.

  1. Guest

    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
     
    , Apr 17, 2008
    #1
    1. Advertisements

  2. In article <>,
    <> wrote:

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


    Please consult a newsgroup appropriate for the operating system
    and toolchain that you are using. The C language itself does not
    know anything about shared modules or dynamic loading.

    [OT]

    In SGI IRIX, this would be handled by the 'ld' option -init
    --
    "The slogans of an inadequate criticism peddle ideas to fashion"
    -- Walter Benjamin
     
    Walter Roberson, Apr 17, 2008
    #2
    1. Advertisements

  3. On 17 Apr 2008 at 5:23, Walter Roberson wrote:
    > In article <>,
    > <> wrote:
    >
    >>I need to trigger a function, whenever my shared module (.so) gets
    >>loaded and before its been used by application.

    >
    > In SGI IRIX, this would be handled by the 'ld' option -init


    On GNU at least, you can also just include a function called _init, and
    the linker will use that without needing a special option.
     
    Antoninus Twink, Apr 17, 2008
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony Cheng
    Replies:
    1
    Views:
    8,612
    Juan T. Llibre
    Feb 24, 2006
  2. Alessandro Crugnola *sephiroth*

    py2exe: dynamic module does not define init function

    Alessandro Crugnola *sephiroth*, Sep 22, 2003, in forum: Python
    Replies:
    6
    Views:
    1,071
    Alessandro Crugnola *sephiroth*
    Sep 22, 2003
  3. Balaji
    Replies:
    1
    Views:
    1,037
    Michael Hudson
    Aug 12, 2004
  4. Bill Davy
    Replies:
    1
    Views:
    4,172
    myk_raniu
    Jun 24, 2009
  5. Replies:
    1
    Views:
    877
    Jules
    Aug 18, 2005
  6. Jess
    Replies:
    4
    Views:
    654
  7. news.aon.at
    Replies:
    11
    Views:
    893
    Ian Collins
    Jan 29, 2011
  8. Roedy Green

    trigger static init

    Roedy Green, Apr 9, 2012, in forum: Java
    Replies:
    16
    Views:
    934
    Andreas Leitgeb
    Apr 22, 2012
Loading...