.\" $OpenBSD: vwaitforio.9,v 1.4 2002/02/28 19:22:05 csapuntz Exp $ .Dd February 26, 2001 .Dt vwaitforio 9 .Os OpenBSD 2.9 .Sh NAME .Nm vwaitforio .Nd wait for all outstanding asynchronous writes .Sh SYNOPSIS .Fd #include .Fd #include .Ft int .Fn "vwaitforio" "struct vnode *vp" "int slpflag" "char *wmesg" "int slptimeo" .Sh DESCRIPTION The .Fn vwaitforio call sleeps until all asynchronous writes associated with the vnode .Nm vp finish. This is used by functions that need to make sure that the writes they initiated have completed. .Pp The .Fn vwaitforio call sleeps at PRIBIO + 1. The .Nm slpflag , .Nm wmesg , and .Nm slptimeo flags indicate flags to be passed to .Xr tsleep 9 . .Pp This function must be called at splbio(). .Pp It may be important to ensure that no other process submits asynchronous writes while you are waiting for I/O on this vnode. Otherwise, vwaitforio may never return. .Pp (Vnode interlock??) .Sh RETURN VALUES The .Fn vwaitforio function returns 0 on success. See .Xr tsleep 9 for possible error returns. .Sh SEE ALSO .Xr vnode 9 , .Xr tsleep 9