|
|
#include <sys/buf.h>void clrbuf(struct buf
bp);
bp->b_un.b_words for the number of bytes
specified in bp->b_bcount.
clrbuf also sets bp->b_resid to zero (0).
b_words, b_bcount,
and b_resid are members in the
buf structure that is defined
in the <sys/buf.h> header file.
Call the
geteblk(D3oddi)
routine to get a buffer before calling clrbuf. The
geteblk routine assigns a value to
b_bcount. clrbuf must be used to ensure that the
buffer is cleared as geteblk does not clear the
buffer. The standard way to call clrbuf is as follows:
bp = geteblk(); /* Get a buffer */ clrbuf(bp); /* Clear it */If your driver is using a non-standard buffering scheme that is managed with buf headers, ensure that
b_bcount is set to a value the same as,
or less than, the size of the buffer.
If b_bcount is set to a value larger than
the current buffer size, data may be destroyed.
b_bcount is set
to SBUFSIZE by the
geteblk( )
function.
SBUFSIZE is defined in <sys/param.h>
and varies according to system buffer size.