libld, ld_open, ld_close - records calls to memory allocation functions |
#include <ld.h> |
int ld_open(path) const char *path; |
int ld_close(void) |
path |
Specifies the path of a log file to be recorded. |
The ld_open function opens a log file for writing, whose name is the string pointed to by path, and starts to record calls to memory allocation functions into the log file. If the file already exists, ld_open truncates it to zero length, and overwrites. Otherwise, ld_open creates the file. |
The ld_close function closes a log file, and stops recording calls to memory allocation functions. |
If successful, ld_open and ld_close return a non-negative integer. They return -1 on failure. |
The libld library uses dlsym(3). In some platform, the library need to be linked using the -ldl option to ld(1). |
ldbrowse(1), ldcollect(1), dlsym(3) |