xref: /freebsd/share/man/man9/BUF_TIMELOCK.9 (revision dd41de95a84d979615a2ef11df6850622bf6184e)
1.\"
2.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice(s), this list of conditions and the following disclaimer as
9.\"    the first lines of this file unmodified other than the possible
10.\"    addition of one or more copyright notices.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice(s), this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25.\" DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd July 9, 2001
30.Dt BUF_TIMELOCK 9
31.Os
32.Sh NAME
33.Nm BUF_TIMELOCK
34.Nd "locks a buffer"
35.Sh SYNOPSIS
36.In sys/param.h
37.In sys/systm.h
38.In sys/uio.h
39.In sys/bio.h
40.In sys/buf.h
41.Ft int
42.Fn BUF_TIMELOCK "struct buf *bp" "int locktype" "char *wmesg" "int catch" "int timo"
43.Sh DESCRIPTION
44The
45.Fn BUF_TIMELOCK
46function locks the given buffer, and limits the amount of time it
47will sleep to
48.Fa timo
49and OR's
50.Fa catch
51into the sleep's priority.
52.Fa wmesg
53is the wmesg used in the sleep.
54.Pp
55Its arguments are:
56.Bl -tag -width ".Fa locktype"
57.It Fa bp
58The buffer to lock.
59.It Fa locktype
60Flags controlling the type of lock.
61See
62.Xr lockmgr 9
63for details.
64.It Fa wmesg
65The wmesg used in any sleeps while acquiring the lock.
66.It Fa catch
67Priority OR'd into the sleep's priority.
68.It Fa timo
69The timeout for any sleeps encountered during the lock.
70.El
71.Sh RETURN VALUES
72A value of 0 is returned on success.
73See
74.Xr lockmgr 9
75for details on non-zero return values.
76.Sh SEE ALSO
77.Xr buf 9 ,
78.Xr BUF_LOCK 9 ,
79.Xr BUF_UNLOCK 9 ,
80.Xr lockmgr 9
81.Sh AUTHORS
82This manual page was written by
83.An Chad David Aq Mt davidc@acns.ab.ca .
84