Current File : //usr/share/man/man9f/bp_copyin.9f
'\" te
.\"  Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
.TH bp_copyin 9F "16 Oct 2007" "SunOS 5.11" "Kernel Functions for Drivers"
.SH NAME
bp_copyin \- copy from a buf(9S) into a driver buffer
.SH SYNOPSIS
.LP
.nf
#include <sys/types.h>
#include <sys/buf.h>

\fBint\fR \fBbp_copyin\fR(\fBstruct buf *\fR\fIbp\fR, \fBvoid *\fR\fIdriverbuf\fR, \fBoffset_t\fR \fIoffset\fR, 
     \fBsize_t\fR \fIsize\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
Architecture independent level 1 (DDI/DKI).
.SH PARAMETERS
.sp
.ne 2
.mk
.na
\fB\fIbp\fR\fR
.ad
.RS 13n
.rt  
Pointer to the buffer header structure to copy from.
.RE

.sp
.ne 2
.mk
.na
\fB\fIdriverbuf\fR\fR
.ad
.RS 13n
.rt  
Driver buffer to copy to.
.RE

.sp
.ne 2
.mk
.na
\fB\fIoffset\fR\fR
.ad
.RS 13n
.rt  
Offset into \fIbp\fR where to start copying.
.RE

.sp
.ne 2
.mk
.na
\fB\fIsize\fR\fR
.ad
.RS 13n
.rt  
Size of copy.
.RE

.SH DESCRIPTION
.sp
.LP
The \fBbp_copyin()\fR function copies \fIsize\fR bytes into the memory associated with \fIbp\fR to the destination driver buffer \fIdriverbuf\fR. The \fIoffset\fR only applies to \fIbp\fR.
.SH RETURN VALUES
.sp
.LP
Under normal conditions, 0 is returned to indicate a successful copy. Otherwise, -1 is returned if \fIbp\fR references invalid pages.
.SH CONTEXT
.sp
.LP
The \fBbp_copyin()\fR function can be called from user or kernel context only.
.SH SEE ALSO
.sp
.LP
\fBbp_copyout\fR(9F), \fBbp_mapin\fR(9F), \fBbp_mapout\fR(9F), \fBddi_copyout\fR(9F), \fBbuf\fR(9S)