xref: /netbsd/lib/libc/sys/lfs_segwait.2 (revision bf9ec67e)
1.\"	$NetBSD: lfs_segwait.2,v 1.4 2002/02/08 01:28:18 ross Exp $
2.\"
3.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Konrad Schroder.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd May 23, 2000
38.Dt LFS_SEGWAIT 2
39.Os
40.Sh NAME
41.Nm lfs_segwait
42.Nd wait until a segment is written
43.Sh LIBRARY
44.Lb libc
45.Sh SYNOPSIS
46.Fd #include \*[Lt]sys/types.h\*[Gt]
47.Ft int
48.Fn lfs_segwait "fsid_t *fsidp" "struct timeval *tv"
49.Sh DESCRIPTION
50.Fn lfs_segwait
51blocks until a new segment is acquired for writing by the filesystem
52specified by
53.Fa *fsidp
54or if
55.Fa *fsidp
56is -1, until a segment is acquired for writing by any LFS filesystem.
57.Pp
58If
59.Fa timeout
60is non-zero,
61.Fn lfs_segwait
62will return after
63.Fa timeout
64milliseconds regardless of whether a new segment has been designated for
65writing or not.
66.Sh RETURN VALUES
67.Fn lfs_segwait
68returns 0 if a new segment was acquired; 1 if it timed out; or -1 on error.
69.Sh ERRORS
70An error return from
71.Fn lfs_segwait
72indicates:
73.Bl -tag -width Er
74.It Bq Er EFAULT
75.Fa fsidp
76points outside the process's allocated address space.
77.It Bq Er EINTR
78A signal was delivered before the time limit expired and
79before a new segment was designated for writing.
80.It Bq Er EINVAL
81The specified time limit is negative.
82.El
83.Sh SEE ALSO
84.Xr lfs_bmapv 2 ,
85.Xr lfs_markv 2 ,
86.Xr lfs_segclean 2 ,
87.Xr lfs_cleanerd 8
88.Sh HISTORY
89The
90.Fn lfs_segwait
91function call appeared in
92.Bx 4.4 .
93