.TH copyout() "" "" "DDI/DKI Kernel Routine"
.PC "Copy data into a user buffer from a driver buffer"
.B "#include <sys/types.h>"
\fBint copyout(\fIdriver\^\fB, \fIuser\^\fB, \fIbytes\^\fB)\fR
\fBcaddr_t \fIdriver\^\fB, \fIuser\^\fB; size_t \fIbytes\^\fB;\fR
.PP
.B copyout()
copies
.I bytes
of data from address
.IR driver ,
which lies within the kernel's data space, to address
.IR user ,
which lies within theuser's data space.
.I user
must point to at least
.I bytes
of allocated memory.
If the memory to which
.I driver
points does not lie entirely within the kernel's space, the system may panic.
.PP
If all goes well,
.B copyout()
returns zero;
otherwise, it returns \-1.
.SH "See Also"
.B
copyin(),
DDI/DKI kernel routines,
uiomove(),
ureadc(),
uwritec()
.R
.SH Notes
.B copyout()
has base level.
It can sleep.
.PP
A driver cannot hold
a driver-defined basic lock or a read/write lock across a
call to this function; it can, however, hold a driver-defined sleep lock.
When it holds a sleep lock, a driver must
be careful to avoid creating a deadlock.
.PP
This function is equivalent to the internal-kernel routine
.BR kucopy() .
