knlist - not supported; use getksym (CrUn166)
The knlist routine exists on Tru64 UNIX, but not on HP-UX.
The knlist routine looks up addresses of kernel symbols in the currently running kernel. In addition to finding symbols associated with the kernel image, knlist will also find symbols defined in dynamically loaded subsystems.
To use this routine, get the address of the parameter in the running kernel using knlist, then get the value at that address by using the open function on /dev/kmem, and then use the lseek, read, and close functions.
The following examples shows how to use the knlist routine on Tru64 UNIX:
knlist(struct nlist namelist); /* struct nlist contains:
char *name; (name of the symbol)
unsigned long value; (value of the symbol)
short type; (type of the symbol)
On HP-UX the getksym routine is similar to knlist on Tru64 UNIX. The ioctl routines on /dev/kmem also have similar functionality. See kmem manpage for more information.
Review your code and replace knlist routine with getksym or ioctl routines on /dev/kmem, which ever is better suited for your application.
Make sure the appropriate header files are also included. Refer to the manpages for more details about getksym and kmem routines.
The following example shows how to use the getksym routine on HP-UX:
getksym(char *name, char *modname, uint64_t *value, uint64_t *type);
/* name : name of the symbol
modname : name of the loaded kernel
module. If modname = NULL, then the search
order for the symbol will be the static kernel
followed by each of the currently loaded
modules in the order in which they were loaded
value : value of the symbol
type : type of the symbol
||any HP-UX 11i version