Hi,
I am developing a shared library for preloading that will intercept certain standard C/C++ calls such as malloc/calloc.
It needs to perform certain initialization, which ought to happen when it is first called.
However the library cannot tell if main() has started or not. Note that a bunch of stuff happens before main() on most operating systems and my library gets called a few times even before main() is called.
My library needs to know that main has started, or that it has not started.
But how?
Anyone have ideas?
Thanks!
I am developing a shared library for preloading that will intercept certain standard C/C++ calls such as malloc/calloc.
It needs to perform certain initialization, which ought to happen when it is first called.
However the library cannot tell if main() has started or not. Note that a bunch of stuff happens before main() on most operating systems and my library gets called a few times even before main() is called.
My library needs to know that main has started, or that it has not started.
But how?
Anyone have ideas?
Thanks!