biowait(9F)
NAME
biowait − suspend processes pending completion of block I/O
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
int biowait(struct buf ∗bp);
ARGUMENTS
bp Pointer to the buf structure.
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
DESCRIPTION
biowait() suspends process execution during a block I/O transfer by calling sleep(). Block driver routines using the buf structure to allocate buffers can use the biowait() function to suspend a process while waiting for a read or write request to complete.
biowait() is one of three functions used to aid block I/O transfers. The other functions in this group are biodone(9F), which notifies biowait() that the I/O is complete, and brelse(9F), which frees the buffer allocated for the transfer.
Because biowait() calls sleep(), drivers using the biowait() must also include biodone(9F) in their interrupt routines. The biodone(9F) function awakens biowait() when the I/O transfer is complete.
Because biowait() calls sleep(), biowait() cannot be called from an interrupt routine.
RETURN VALUES
None. However, biowait() returns any error that may have occurred during the I/O transfer to the user using geterror(9F).
CONTEXT
biowait() can be called from user context only.
SEE ALSO
biodone(9F), brelse(9F), timeout(9F), untimeout(9F)
SunOS 5.1 — Last change: 11 Apr 1991