macro and text revision (-mdoc version 3)
[unix-history] / usr / src / lib / libc / gen / getmntinfo.3
CommitLineData
ae59e04c 1.\" Copyright (c) 1989, 1991 The Regents of the University of California.
7241dcec
KM
2.\" All rights reserved.
3.\"
91cff1e1 4.\" %sccs.include.redist.man%
7241dcec 5.\"
ae59e04c 6.\" @(#)getmntinfo.3 6.5 (Berkeley) %G%
7241dcec 7.\"
ae59e04c
CL
8.Dd
9.Dt GETMNTINFO 3
10.Os
11.Sh NAME
12.Nm getmntinfo
13.Nd get information about mounted file systems
14.Sh SYNOPSIS
15.Fd #include <sys/types.h>
16.Fd #include <sys/mount.h>
17.Ft int
18.Fn getmntinfo "int mntbufp" "int flags"
19.Sh DESCRIPTION
20The
21.Fn getmntinfo
22function
7241dcec 23returns an array of
ae59e04c 24.Xr statfs
7241dcec 25structures describing each currently mounted file system (see
ae59e04c
CL
26.Xr statfs 2 ) .
27.Pp
28The
29.Fn getmntinfo
30function
e14902d3 31passes its
ae59e04c 32.Fa flags
e14902d3 33parameter transparently to
ae59e04c
CL
34.Xr getfsstat 2 .
35.Sh RETURN VALUES
343e6500 36On successful completion,
ae59e04c 37.Fn getmntinfo
343e6500
KB
38returns a count of the number of elements in the array.
39The pointer to the array is stored into
ae59e04c
CL
40.Fa mntbufp .
41.Pp
343e6500 42If an error occurs, zero is returned and the external variable
ae59e04c 43.Va errno
343e6500
KB
44is set to indicate the error.
45Although the pointer
ae59e04c 46.Fa mntbufp
343e6500 47will be unmodified, any information previously returned by
ae59e04c 48.Fn getmntinfo
343e6500 49will be lost.
ae59e04c
CL
50.Sh ERRORS
51The
52.Fn getmntinfo
53function
343e6500
KB
54may fail and set errno for any of the errors specified for the library
55routines
ae59e04c 56.Xr getfsstat 2
343e6500 57or
ae59e04c
CL
58.Xr malloc 3 .
59.Sh SEE ALSO
60.Xr getfsstat 2 ,
61.Xr statfs 2 ,
62.Xr mount 2 ,
63.Xr mount 8
64.Sh HISTORY
65The
66.Fn getmntinfo
67function is
68.Ud .
69.Sh BUGS
70The
71.Fn getmntinfo
72function writes the array of structures to an internal static object
73and returns
74a pointer to that object. Subsequent calls to
75.Fn getmntinfo
76will modify the same object.
77.Pp
78The memory allocated by
79.Fn getmntinfo
80cannot be
81.Xr free 2 Ns 'd
82by the application.