'\" te .\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved .TH kvm_read 3KVM "2 May 2002" "SunOS 5.11" "Kernel VM Library Functions" .SH NAME kvm_read, kvm_write \- copy data to or from a kernel image or running system .SH SYNOPSIS .LP .nf \fBcc\fR [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lkvm\fR [ \fIlibrary\fR\&.\|.\|.] #include \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); .fi .LP .nf \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); .fi .SH DESCRIPTION .sp .LP The \fBkvm_read()\fR function transfers data from the kernel image specified by \fIkd\fR (see \fBkvm_open\fR(3KVM)) to the address space of the process. \fInbytes\fR bytes of data are copied from the kernel virtual address given by \fIaddr\fR to the buffer pointed to by \fIbuf\fR. .sp .LP The \fBkvm_write()\fR function is like \fBkvm_read()\fR, except that the direction of data transfer is reversed. To use this function, the \fBkvm_open\fR(3KVM) call that returned \fIkd\fR 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 \fBkvm_getu\fR(3KVM) call. .SH USAGE .sp .LP The \fBkvm_read()\fR and \fBkvm_write()\fR functions are obsolete and might be removed in a future release. The functions described on the \fBkvm_kread\fR(3KVM) manual page should be used instead. .SH RETURN VALUES .sp .LP On success, these functions return the number of bytes actually transferred. On failure, they return \fB\(mi1\fR\&. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityObsolete _ MT-LevelUnsafe .TE .SH SEE ALSO .sp .LP \fBkvm_getu\fR(3KVM), \fBkvm_kread\fR(3KVM)\fBkvm_nlist\fR(3KVM), \fBkvm_open\fR(3KVM), \fBattributes\fR(5)