CyberPsychotic <[EMAIL PROTECTED]> writes:

> Now the problem is how would I call the original routine within my
> library?

        if (!orig_fopen)
                orig_fopen = dlsym(RTLD_NEXT, "fopen");

should do what you want.  (RTLD_NEXT isn't documented in the dlsym
manpage, just in <dlfcn.h>, which says

/* If the first argument of `dlsym' is set to RTLD_NEXT the run-time
   address of the symbol called NAME in the next shared object is
   returned.  The "next" relation is defined by the order the shared
   objects were loaded.  */
#define RTLD_NEXT       ((void *) -1l)
)

Reply via email to