473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Jun 27 '08 #1
3 1612
In article <80**********************************@c65g2000hsa. googlegroups.com>,
<ra******@gmail.comwrote:
>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
Jun 27 '08 #2
On 17 Apr 2008 at 5:23, Walter Roberson wrote:
In article <80**********************************@c65g2000hsa. googlegroups.com>,
<ra******@gmail.comwrote:
>>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.

Jun 27 '08 #3
ra******@gmail.com wrote:
>
I need to trigger a function, whenever my shared module (.so) gets
loaded and before its been used by application.
Ignoring off-topic things such as .so, consider the following:

void checkinit(void) {
static int initdone = 0;

if (initdone) return;
else {
initdone = 1;
/* whatever initialization is needed */
}
return;
}

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kj | last post by:
How does one trigger an event programmatically? I'm interested in how to do this in both the "Level 0" event model as well as in the DOM Level 2 event model. Thanks! kj -- NOTE: In my...
1
by: TimMcConechy | last post by:
Hi, In a trigger I need to do a SET CURRENT SCHEMA so that I update the right set of tables based on some "new" values I recieve in the trigger.. the logic looks a little like: DECLARE...
0
by: JohnO | last post by:
Thanks to Serge and MarkB for recent tips and suggestions. Ive rolled together a few stored procedures to assist with creating audit triggers automagically. Hope someone finds this as useful as...
26
by: Adam Warner | last post by:
Hello all, I'm very new to C but I have a number of years of Common Lisp programming experience. I'm trying to figure out ways of translating higher order concepts such as closures into C. The...
4
by: Chris | last post by:
Hello, I'm just getting started with VB and am new to the group, so please excuse what may seem to be a rudimentary question. I've been writing basic programs and have noticed that the...
2
by: Juan Jose Costello Levien | last post by:
Hello, I am trying to use a trigger function I wrote in C. Basically what I want to do is to audit a table when a row is inserted into another table by copying the row to the new table. It...
8
by: Ender.Dai | last post by:
I have writen following demo code, but it doesn't work :( Source code: -------------------------------- /* hello.c */ #include <stdio.h> extern int hello_init() __attribute__...
1
by: kickslop | last post by:
Clearly I am doing something braindead here with psycopg 1.1.21 (psycopg2 is not an option). Any ideas? I get the same results when I build it with Red Hat's GCC 3.4.6 setup as well as our...
2
by: beginner | last post by:
Hi Everyone, An extended module (.pyd) written in C have an init function that is called when the module is imported. Does anyone know if there is a way to provide an init function for a module...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.