Unleashed v1.4
[unleashed.git] / share / man / man3kvm / kvm_read.3kvm
blob9147a3441782d7e3e14af410d680ac710bacdf23
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_READ 3KVM "May 2, 2002"
7 .SH NAME
8 kvm_read, kvm_write \- copy data to or from a kernel image or running system
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lkvm\fR [ \fIlibrary\fR\&.\|.\|.]
13 #include <kvm.h>
15 \fBssize_t\fR \fBkvm_read\fR(\fBkvm_t *\fR\fIkd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR);
16 .fi
18 .LP
19 .nf
20 \fBssize_t\fR \fBkvm_write\fR(\fBkvm_t *\fR\fIkd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR);
21 .fi
23 .SH DESCRIPTION
24 .sp
25 .LP
26 The \fBkvm_read()\fR function transfers data from the kernel image specified by
27 \fIkd\fR (see \fBkvm_open\fR(3KVM)) to the address space of the process.
28 \fInbytes\fR bytes of data are copied from the kernel virtual address given by
29 \fIaddr\fR to the buffer pointed to by \fIbuf\fR.
30 .sp
31 .LP
32 The \fBkvm_write()\fR function is like \fBkvm_read()\fR, except that the
33 direction of data transfer is reversed. To use this function, the
34 \fBkvm_open\fR(3KVM) call that returned \fIkd\fR must have specified write
35 access. If a user virtual address is given, it is resolved in the address space
36 of the process specified in the most recent \fBkvm_getu\fR(3KVM) call.
37 .SH USAGE
38 .sp
39 .LP
40 The \fBkvm_read()\fR and \fBkvm_write()\fR functions are obsolete and might be
41 removed in a future release. The functions described on the
42 \fBkvm_kread\fR(3KVM) manual page should be used instead.
43 .SH RETURN VALUES
44 .sp
45 .LP
46 On success, these functions return the number of bytes actually transferred. On
47 failure, they return \fB\(mi1\fR\&.
48 .SH ATTRIBUTES
49 .sp
50 .LP
51 See \fBattributes\fR(5) for descriptions of the following attributes:
52 .sp
54 .sp
55 .TS
56 box;
57 c | c
58 l | l .
59 ATTRIBUTE TYPE  ATTRIBUTE VALUE
61 Interface Stability     Obsolete
63 MT-Level        Unsafe
64 .TE
66 .SH SEE ALSO
67 .sp
68 .LP
69 \fBkvm_getu\fR(3KVM), \fBkvm_kread\fR(3KVM), \fBkvm_nlist\fR(3KVM),
70 \fBkvm_open\fR(3KVM), \fBattributes\fR(5)