Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Dave Butenhof <butenhof@zko.dec.com>
Subject: Re: A query on shared library in Digital UNIX 4.0 ....
Date: 1997/04/21	[thread overview]
Message-ID: <335B5350.58E@zko.dec.com> (raw)
In-Reply-To: 33575472.33DF@wipsys.stph.net


Kamal Kishore Mantri wrote:
> 
>         I want to intialize some global data & acquire few
> system resources(mutexes, shared memory .. etc) when shared
> library is loaded. Similiarly these resouces need to released
> when shared library is unloaded. Can anybody suggest me a way
> of doing this in Digital UNIX 4.0. In HP-UX , it could have
> been done with +I_INITIALIZER flag in ld.

Two ways:

1) Create a routine with the name __init_[anything], for example,
   __init_mylib. The loader will call all routines with this format
   when the library is loaded. Similarly, __fini_[anything] routines
   are called before the library is unloaded.
2) Use the ld options -init <name> and -fini <name> to cause specific
   functions to be called at load and unload time.

/---[ Dave Butenhof ]-----------------------[ butenhof@zko.dec.com ]---\
| Digital Equipment Corporation           110 Spit Brook Rd ZKO2-3/Q18 |
| 603.881.2218, FAX 603.881.0120                  Nashua NH 03062-2698 |
\-----------------[ Better Living Through Concurrency ]----------------/



  reply	other threads:[~1997-04-21  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  4:00 A query on shared library in Digital UNIX 4.0 Kamal Kishore Mantri
1997-04-21  4:00 ` Dave Butenhof [this message]
1997-05-07  4:00 ` Craig Neth USG
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox