Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kvm_getu(3K)

kvm_nlist(3K)

kvm_open(3K)

KVM_READ(3K)  —  KERNEL VM LIBRARY FUNCTIONS

NAME

kvm_read, kvm_write − copy data to or from a kernel image or running system

SYNOPSIS

#include <kvm.h>

int kvm_read(kd, addr, buf, nbytes)
kvm_t ∗kd;
unsigned long addr;
char ∗buf;
unsigned nbytes;

int kvm_write(kd, addr, buf, nbytes)
kvm_t ∗kd;
unsigned long addr;
char ∗buf;
unsigned nbytes;

DESCRIPTION

kvm_read() transfers data from the kernel image specified by kd (see kvm_open(3K)) to the address space of the process.  nbytes bytes of data are copied from the kernel virtual address given by addr to the buffer pointed to by buf.

kvm_write() is like kvm_read(), except that the direction of data transfer is reversed.  In order to use this function, the kvm_open() call that returned kd must have specified write access.  If a user virtual address is given, it is resolved in the address space of the process specified in the most recent kvm_getu(3K) call. 

RETURN VALUE

Upon normal completion, the number of bytes successfully transferred is returned.  Otherwise −1 is returned. 

SEE ALSO

kvm_getu(3K), kvm_nlist(3K), kvm_open(3K)

Sun Release 4.0  —  Last change: 21 May 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026