'\" te .\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved .TH kvm_kread 3KVM "2 May 2002" "SunOS 5.11" "Kernel VM Library Functions" .SH NAME kvm_kread, kvm_kwrite, kvm_uread, kvm_uwrite \- 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_kread\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_kwrite\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_uread\fR(\fBkvm_t\fR \fI*kd\fR, \fBuintptr_t\fR \fIaddr\fR, \fBvoid *\fR\fIbuf\fR, \fBsize_t\fR \fInbytes\fR); .fi .LP .nf \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); .fi .SH DESCRIPTION .sp .LP The \fBkvm_kread()\fR function transfers data from the kernel address space 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_kwrite()\fR function is like \fBkvm_kread()\fR, except that the direction of the transfer is reversed. To use this function, the \fBkvm_open\fR(3KVM) call that returned \fIkd\fR must have specified write access. .sp .LP The \fBkvm_uread()\fR function transfers data from the address space of the processes specified in the most recent \fBkvm_getu\fR(3KVM) call. \fInbytes\fR bytes of data are copied from the user virtual address given by \fIaddr\fR to the buffer pointed to by \fIbuf\fR. .sp .LP The \fBkvm_uwrite()\fR function is like \fBkvm_uread()\fR, except that the direction of the transfer is reversed. To use this function, the \fBkvm_open\fR(3KVM) call that returned \fIkd\fR must have specified write access. The address is resolved in the address space of the process specified in the most recent \fBkvm_getu\fR(3KVM) call. .SH RETURN VALUES .sp .LP On success, these functions return the number of bytes actually transferred. On failure, they return \(mi1. .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 StabilityCommitted _ MT-LevelUnsafe .TE .SH SEE ALSO .sp .LP \fBkvm_getu\fR(3KVM), \fBkvm_nlist\fR(3KVM), \fBkvm_open\fR(3KVM), \fBattributes\fR(5)