From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,b3cc53a4cd752b49,start X-Google-Attributes: gidfee84,public From: john hall Subject: Wrappers for shared library functions? Date: 1997/03/05 Message-ID: <331D5BCE.5329@netcomuk.co.uk>#1/1 X-Deja-AN: 223141345 Organization: NETCOM Internet Ltd. Newsgroups: comp.unix.osf.osf1 I would be very grateful for any advice on how to create "wrappers" for one or two functions in large shared libraries, such that a calling program will invoke the wrapper function which in turn calls the original function to do the majority of the "work". The replumbing should ideally be entirely transparent both to the calling program and to the shared library functions at run time. The wrapper could be used for monitoring usage and possibly "tweaking" the parameters supplied by the calling program or the results returned by a library function. It seems possible that by creating a library of wrappers dependent on the "real" shared library and with a bit of renaming that the wrappers could be interposed between the calling program and the "real" functions. However I am unclear on how to provide the calling program with access to all the "real" shared library functions without having to write wrappers for all (maybe lots) of them - and then, what about other symbols exported from the "real" library such as external variables which may be referenced in a main program? Thanks for any advice on this. john hall jhall@netcomuk.co.uk