summaryrefslogtreecommitdiff
path: root/share/man/man9/vwaitforio.9
blob: 630a814124b05abf4f1bfbc9763be1059b1e5fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.Dd February 26, 2001
.Dt vwaitforio 9
.Os OpenBSD 2.9
.Sh NAME
.Nm vwaitforio
.Nd wait for all outstanding 
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.Fd #include <sys/vnode.h>
.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