xref: /openbsd-src/share/man/man9/vwaitforio.9 (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1.Dd February 26, 2001
2.Dt vwaitforio 9
3.Os OpenBSD 2.9
4.Sh NAME
5.Nm vwaitforio
6.Nd wait for all outstanding
7.Sh SYNOPSIS
8.Fd #include <sys/types.h>
9.Fd #include <sys/vnode.h>
10.Ft int
11.Fn "vwaitforio" "struct vnode *vp" "int slpflag" "char *wmesg" "int slptimeo"
12.Sh DESCRIPTION
13The
14.Fn vwaitforio
15call sleeps until all asynchronous writes associated with the vnode
16.Nm vp
17finish. This is used by functions that need to make sure
18that the writes they initiated have completed.
19.Pp
20The
21.Fn vwaitforio
22call sleeps at PRIBIO + 1. The
23.Nm slpflag ,
24.Nm wmesg ,
25and
26.Nm slptimeo
27flags indicate flags to be passed to
28.Xr tsleep 9 .
29.Pp
30This function must be called at splbio().
31.Pp
32It may be important to ensure that no other process submits asynchronous
33writes while you are waiting for I/O on this vnode. Otherwise,
34vwaitforio may never return.
35.Pp
36(Vnode interlock??)
37.Sh RETURN VALUES
38The
39.Fn vwaitforio
40function returns 0 on success. See
41.Xr tsleep 9
42for possible error returns.
43.Sh SEE ALSO
44.Xr vnode 9 ,
45.Xr tsleep 9
46