9762 Split the custr functions into their own library
[unleashed.git] / usr / src / man / man3kvm / kvm_kread.3kvm
blobec6f0374fa4539aa47048fb4967c9ad0c4cb46f8
1 '\" te
2 .\"  Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH KVM_KREAD 3KVM "May 2, 2002"
7 .SH NAME
8 kvm_kread, kvm_kwrite, kvm_uread, kvm_uwrite \- copy data to or from a kernel
9 image or running system
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBcc\fR [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lkvm\fR [ \fIlibrary\fR\&.\|.\|.]
14 #include <kvm.h>
16 \fBssize_t\fR \fBkvm_kread\fR(\fBkvm_t *\fR\fIkd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR);
17 .fi
19 .LP
20 .nf
21 \fBssize_t\fR \fBkvm_kwrite\fR(\fBkvm_t *\fR\fIkd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR);
22 .fi
24 .LP
25 .nf
26 \fBssize_t\fR \fBkvm_uread\fR(\fBkvm_t\fR \fI*kd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR);
27 .fi
29 .LP
30 .nf
31 \fBssize_t\fR \fBkvm_uwrite\fR(\fBkvm_t *\fR\fIkd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR);
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBkvm_kread()\fR function transfers data from the kernel address space to
38 the address space of the process. \fInbytes\fR bytes of data are copied from
39 the kernel virtual address given by \fIaddr\fR to the buffer pointed to by
40 \fIbuf\fR.
41 .sp
42 .LP
43 The \fBkvm_kwrite()\fR function is like \fBkvm_kread()\fR, except that the
44 direction of the transfer is reversed. To use this function, the
45 \fBkvm_open\fR(3KVM) call that returned  \fIkd\fR must have specified write
46 access.
47 .sp
48 .LP
49 The \fBkvm_uread()\fR function transfers data from the address space of the
50 processes specified in the most recent  \fBkvm_getu\fR(3KVM) call. \fInbytes\fR
51 bytes of data are copied from the user virtual address given by \fIaddr\fR to
52 the buffer pointed to by \fIbuf\fR.
53 .sp
54 .LP
55 The \fBkvm_uwrite()\fR function is like \fBkvm_uread()\fR, except that the
56 direction of the transfer is reversed. To use this function, the
57 \fBkvm_open\fR(3KVM) call that returned \fIkd\fR must have specified write
58 access. The address is resolved in the address space of the process specified
59 in the most recent \fBkvm_getu\fR(3KVM) call.
60 .SH RETURN VALUES
61 .sp
62 .LP
63 On success, these functions return the number of bytes actually transferred. On
64 failure, they return \(mi1.
65 .SH ATTRIBUTES
66 .sp
67 .LP
68 See \fBattributes\fR(5) for descriptions of the following attributes:
69 .sp
71 .sp
72 .TS
73 box;
74 c | c
75 l | l .
76 ATTRIBUTE TYPE  ATTRIBUTE VALUE
78 Interface Stability     Stable
80 MT-Level        Unsafe
81 .TE
83 .SH SEE ALSO
84 .sp
85 .LP
86 \fBkvm_getu\fR(3KVM), \fBkvm_nlist\fR(3KVM), \fBkvm_open\fR(3KVM),
87 \fBattributes\fR(5)