kmem.7 (2010 09)

k
kmem(7) kmem(7)
NAME
kmem - perform I/O on kernel memory, based on symbol name
SYNOPSIS
#include <sys/ksym.h>
int ioctl(
int kmemfd,
int command,
void *rks
);
DESCRIPTION
When used with a valid file descriptor for
/dev/kmem (kmemfd), ioctl can be used to manipulate ker-
nel memory. The specifics of this manipulation depend on the command given as follows:
MIOC_READKSYM
Read mirk_buflen bytes of kernel memory starting at the address for
mirk_symname into mirk_buf . rks is a pointer to a
mioc_rksym structure,
defined below.
MIOC_IREADKSYM
Indirect read. Read sizeof(void *) bytes of kernel memory starting at
the address for mirk_symname and use that as the address from which to read
mirk_buflen bytes of kernel memory into mirk_buf . rks is a pointer to a
mioc_rksym structure.
MIOC_WRITEKSYM Write mirk_buflen bytes from mirk_buf into kernel memory starting at the
address for mirk_symname . rks is a pointer to a
mioc_rksym structure.
MIOC_IWRITEKSYM Indirect write. Read
sizeof(void *) bytes of kernel memory starting at
the address for mirk_symname and use that as the kernel memory address
into which mirk_buflen bytes from mirk_buf are written. rks is a pointer to a
mioc_rksym structure.
MIOC_LOCKSYM Increase the hold count by one for the dynamically loaded module whose name
is given by rks, a pointer to a character string, thereby preventing its unload-
ing.
MIOC_UNLOCKSYM Decrease the hold count by one for the dynamically loaded module whose
name is given by rks, a pointer to a character string. If the count is thereby
reduced to 0, the module becomes a candidate for unloading.
The
struct mioc_rksym definition is:
struct mioc_rksym {
char * mirk_modname; /* limit search for symname
to module modname; if NULL
use standard search order */
char * mirk_symname; /* name of symbol whose address
is the basis for this
operation */
void * mirk_buf; /* buffer into/from which
read/write takes place */
size_t mirk_buflen; /* length (in bytes) of desired
operation */
};
RETURN VALUE
ioctl returns one of the following values:
0 Successful completion.
-1 Failure. errno is set to indicate the error.
ERRORS
In addition to the values described in ioctl (2), the
kmem ioctl also sets errno to one of the following
values if the corresponding condition is detected.
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)