HP-UX Reference (11i v2 03/08) - 2 System Calls (vol 5)

g
getksym(2) getksym(2)
#include <elf.h>
uint64_t value=0x12345678, info=0;
char symname[MAXSYMNMLEN];
/* name will be placed in symname, and offset in info */
if (getksym(symname, NULL, &value, &info) != 0) {
perror("getksym");
return(-1);
}
The following code sequence and call to
getksym() obtains an address given a symbol name.
#include <sys/types.h>
#include <sys/ksym.h>
#include <elf.h>
uint64_t value=0, info=0;
/* The address will be placed in value */
if (getksym("bzero",NULL, &value, &info) != 0) {
perror("getksym");
return(-1);
}
SEE ALSO
kmem(7).
HP-UX 11i Version 2: August 2003 2 Hewlett-Packard Company Section 297