Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit
» 

DSPP Home

» HP STK home
Tru64 UNIX STK
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» FAQ
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
» DSPP
Content starts here

critical impact:

knlist - not supported; use getksym (CrUn166)

KN Impacts

Problem description

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.

Identifiers

C/C++ Functionsknlist          

Old behavior

The following examples shows how to use the knlist routine on Tru64 UNIX:

#include <nlist.h>

int

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)

                                */

See also

Solution description

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.

New behavior

The following example shows how to use the getksym routine on HP-UX:

#include <sys/types.h>
#include <sys/ksym.h>
#include <elf.h>

int

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

                           */

See also


Problem summary

classifications source types OS release severity type
KN C, C++ any HP-UX 11i version critical unavailable
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.