1kvm_kread(3KVM)           Kernel VM Library Functions          kvm_kread(3KVM)
2
3
4

NAME

6       kvm_kread,  kvm_kwrite,  kvm_uread, kvm_uwrite - copy data to or from a
7       kernel image or running system
8

SYNOPSIS

10       cc [ flag... ] file... -lkvm [ library...]
11       #include <kvm.h>
12
13       ssize_t kvm_kread(kvm_t *kd, uintptr_t addr, void *buf, size_t nbytes);
14
15
16       ssize_t kvm_kwrite(kvm_t *kd, uintptr_t addr, void *buf, size_t nbytes);
17
18
19       ssize_t kvm_uread(kvm_t *kd, uintptr_t addr, void *buf, size_t nbytes);
20
21
22       ssize_t kvm_uwrite(kvm_t *kd, uintptr_t addr, void *buf, size_t nbytes);
23
24

DESCRIPTION

26       The kvm_kread() function transfers data from the kernel  address  space
27       to  the  address  space of the process. nbytes bytes of data are copied
28       from the kernel virtual address given by addr to the buffer pointed  to
29       by buf.
30
31
32       The  kvm_kwrite()  function is like kvm_kread(), except that the direc‐
33       tion  of  the  transfer  is  reversed.  To  use  this   function,   the
34       kvm_open(3KVM) call that returned  kd must have specified write access.
35
36
37       The  kvm_uread()  function transfers data from the address space of the
38       processes specified in the most  recent   kvm_getu(3KVM)  call.  nbytes
39       bytes of data are copied from the user virtual address given by addr to
40       the buffer pointed to by buf.
41
42
43       The kvm_uwrite() function is like kvm_uread(), except that  the  direc‐
44       tion   of   the  transfer  is  reversed.  To  use  this  function,  the
45       kvm_open(3KVM) call that returned kd must have specified write  access.
46       The  address  is resolved in the address space of the process specified
47       in the most recent kvm_getu(3KVM) call.
48

RETURN VALUES

50       On success, these functions return the number of bytes actually  trans‐
51       ferred. On failure, they return −1.
52

ATTRIBUTES

54       See attributes(5) for descriptions of the following attributes:
55
56
57
58
59       ┌─────────────────────────────┬─────────────────────────────┐
60       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
61       ├─────────────────────────────┼─────────────────────────────┤
62       │Interface Stability          │Stable                       │
63       ├─────────────────────────────┼─────────────────────────────┤
64       │MT-Level                     │Unsafe                       │
65       └─────────────────────────────┴─────────────────────────────┘
66

SEE ALSO

68       kvm_getu(3KVM), kvm_nlist(3KVM), kvm_open(3KVM), attributes(5)
69
70
71
72SunOS 5.11                        2 May 2002                   kvm_kread(3KVM)
Impressum