HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
d
dlsym(3C) dlsym(3C)
extern void record_malloc(void *, size_t);
void *
malloc(size_t sz)
{
void *ptr;
void *(*real_malloc)(size_t);
real_malloc = (void * (*) (size_t))
dlsym(RTLD_NEXT, "malloc");
ptr = (*real_malloc)(sz);
record_malloc(ptr, sz);
return ptr;
}
SEE ALSO
dlclose(3C), dlerror(3C), dlopen(3C).
Texts and Tutorials:
HP-UX Linker and Libraries Online User Guide
(See the +help option)
HP-UX Linker and Libraries User’s Guide
(See manuals(5) for ordering information)
Section 3158 2 HP-UX Release 11i: December 2000
___
___