.TH bwrite() "" "" "Internal Kernel Routine"
.PC "Write buffer to disk"
.B "#include <sys/buf.h>"
\fBvoid bwrite(\fIbp\^\fB, \fIflag\^\fB)\fR
\fBBUF *\fIbp\^\fB; int \fIflag\^\fB;\fR
.PP
.B bwrite ()
writes out the buffer to which
.I bp
points.
If
.I flag
is set, the write is synchronous and
.B bwrite()
does not return until I/O has completed;
otherwise, the write is asynchronous and
.B bwrite()
returns immediately.
.PP
A device driver must lock the buffer gate before it calls
.BR bwrite() ;
if it does not, the buffer may be modified while it is being written.
.SH "See Also"
.B
internal kernel routines
.R
