xref: /illumos-gate/usr/src/man/man9f/biowait.9f (revision bbf21555)
te
Copyright 1989 AT&T
Copyright (c) 1997, Sun Microsystems, Inc., All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
BIOWAIT 9F "Apr 11, 1991"
NAME
biowait - suspend processes pending completion of block I/O
SYNOPSIS

#include <sys/types.h>
#include <sys/buf.h>



int biowait(struct buf *bp);
INTERFACE LEVEL

Architecture independent level 1 (DDI/DKI).

PARAMETERS
bp

Pointer to the buf structure describing the transfer.

DESCRIPTION

Drivers allocating their own buf structures with getrbuf(9F) can use the biowait() function to suspend the current thread and wait for completion of the transfer.

Drivers must call biodone(9F) when the transfer is complete to notify the thread blocked by biowait(). biodone() is usually called in the interrupt routine.

RETURN VALUES
0

Upon success

non-zero

Upon I/O failure. biowait() calls geterror(9F) to retrieve the error number which it returns.

CONTEXT

biowait() can be called from user context only.

SEE ALSO

biodone (9F), geterror (9F), getrbuf (9F), buf (9S)

Writing Device Drivers