Annotation of src/lib/libc/gen/getmntinfo.3, Revision 1.16
1.16 ! abhinav 1: .\" $NetBSD: getmntinfo.3,v 1.15 2004/05/05 08:48:36 jdolecek Exp $
1.5 cgd 2: .\"
3: .\" Copyright (c) 1989, 1991, 1993
4: .\" The Regents of the University of California. All rights reserved.
1.1 cgd 5: .\"
6: .\" Redistribution and use in source and binary forms, with or without
7: .\" modification, are permitted provided that the following conditions
8: .\" are met:
9: .\" 1. Redistributions of source code must retain the above copyright
10: .\" notice, this list of conditions and the following disclaimer.
11: .\" 2. Redistributions in binary form must reproduce the above copyright
12: .\" notice, this list of conditions and the following disclaimer in the
13: .\" documentation and/or other materials provided with the distribution.
1.13 agc 14: .\" 3. Neither the name of the University nor the names of its contributors
1.1 cgd 15: .\" may be used to endorse or promote products derived from this software
16: .\" without specific prior written permission.
17: .\"
18: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28: .\" SUCH DAMAGE.
29: .\"
1.5 cgd 30: .\" @(#)getmntinfo.3 8.1 (Berkeley) 6/9/93
1.1 cgd 31: .\"
1.16 ! abhinav 32: .Dd June 2, 2016
1.1 cgd 33: .Dt GETMNTINFO 3
34: .Os
35: .Sh NAME
36: .Nm getmntinfo
37: .Nd get information about mounted file systems
1.7 perry 38: .Sh LIBRARY
39: .Lb libc
1.1 cgd 40: .Sh SYNOPSIS
1.14 christos 41: .In sys/types.h
42: .In sys/statvfs.h
1.1 cgd 43: .Ft int
1.14 christos 44: .Fn getmntinfo "struct statvfs **mntbufp" "int flags"
1.1 cgd 45: .Sh DESCRIPTION
46: The
47: .Fn getmntinfo
1.8 fair 48: function returns an array of
1.14 christos 49: .Em statvfs
1.1 cgd 50: structures describing each currently mounted file system (see
1.14 christos 51: .Xr statvfs 2 ) .
1.1 cgd 52: .Pp
53: The
54: .Fn getmntinfo
55: function
56: passes its
57: .Fa flags
58: parameter transparently to
1.14 christos 59: .Xr getvfsstat 2 .
1.1 cgd 60: .Sh RETURN VALUES
61: On successful completion,
62: .Fn getmntinfo
63: returns a count of the number of elements in the array.
64: The pointer to the array is stored into
65: .Fa mntbufp .
66: .Pp
67: If an error occurs, zero is returned and the external variable
68: .Va errno
69: is set to indicate the error.
1.8 fair 70: Although the pointer
1.1 cgd 71: .Fa mntbufp
1.8 fair 72: will be unmodified, any information previously returned by
1.1 cgd 73: .Fn getmntinfo
74: will be lost.
75: .Sh ERRORS
76: The
77: .Fn getmntinfo
78: function
1.8 fair 79: may fail and set
80: .Va errno
1.3 jtc 81: for any of the errors specified for the library routines
1.14 christos 82: .Xr getvfsstat 2
1.8 fair 83: or
1.1 cgd 84: .Xr malloc 3 .
85: .Sh SEE ALSO
1.14 christos 86: .Xr getvfsstat 2 ,
1.10 wiz 87: .Xr mount 2 ,
1.14 christos 88: .Xr statvfs 2 ,
1.1 cgd 89: .Xr mount 8
90: .Sh HISTORY
91: The
92: .Fn getmntinfo
1.6 perry 93: function first appeared in
94: .Bx 4.4 .
1.14 christos 95: It was converted from using
1.16 ! abhinav 96: .Fn getfsstat
1.14 christos 97: to
98: .Xr getvfsstat 2
99: in
1.15 jdolecek 100: .Nx 3.0 .
1.1 cgd 101: .Sh BUGS
102: The
103: .Fn getmntinfo
104: function writes the array of structures to an internal static object
105: and returns
1.8 fair 106: a pointer to that object.
107: Subsequent calls to
1.1 cgd 108: .Fn getmntinfo
109: will modify the same object.
110: .Pp
111: The memory allocated by
112: .Fn getmntinfo
113: cannot be
1.9 fair 114: .Xr free 3 Ns 'd
1.1 cgd 115: by the application.
CVSweb <webmaster@jp.NetBSD.org>