[Prev][Next][Index]

BEHAVIOR OF FUNCTIONS OF DLL AND DYNAMICLY LOADED LIB



Shalom,


I have some questions about functions belonging to a shared library.

1. if a function foo(), from a shared library dynamicly loaded via
'dlopen', declare one of its variable as static, what will happen to
this statis variable if 2, or more, running processes call foo() ?

Is this static variable will be still static relative to each process ?

2. if foo() call fork(), is the parent of the spawned child, the caller
of foo2() ? What's happen if 2 or more running processes call foo() ?

3. is a function from a shared lib dynamicly loaded (with dlopen)
operate _only_ in the address space of the calling process.


  
I would try this myself if I had an ELF system, but I have not :-(.


-- Meir <meir@bis.co.il>