xref: /csrg-svn/lib/libc/gen/getmntinfo.3 (revision 62869)
1*62869Sbostic.\" Copyright (c) 1989, 1991, 1993
2*62869Sbostic.\"	The Regents of the University of California.  All rights reserved.
339318Smckusick.\"
443571Strent.\" %sccs.include.redist.man%
539318Smckusick.\"
6*62869Sbostic.\"     @(#)getmntinfo.3	8.1 (Berkeley) 06/09/93
739318Smckusick.\"
848352Scael.Dd
948352Scael.Dt GETMNTINFO 3
1048352Scael.Os
1148352Scael.Sh NAME
1248352Scael.Nm getmntinfo
1348352Scael.Nd get information about mounted file systems
1448352Scael.Sh SYNOPSIS
1551743Sbostic.Fd #include <sys/param.h>
1651743Sbostic.Fd #include <sys/ucred.h>
1748352Scael.Fd #include <sys/mount.h>
1848352Scael.Ft int
1957534Sbostic.Fn getmntinfo "struct statfs **mntbufp" "int flags"
2048352Scael.Sh DESCRIPTION
2148352ScaelThe
2248352Scael.Fn getmntinfo
2348352Scaelfunction
2439318Smckusickreturns an array of
2548352Scael.Xr statfs
2639318Smckusickstructures describing each currently mounted file system (see
2748352Scael.Xr statfs 2 ) .
2848352Scael.Pp
2948352ScaelThe
3048352Scael.Fn getmntinfo
3148352Scaelfunction
3245628Sbosticpasses its
3348352Scael.Fa flags
3445628Sbosticparameter transparently to
3548352Scael.Xr getfsstat 2 .
3648352Scael.Sh RETURN VALUES
3739318SmckusickOn successful completion,
3848352Scael.Fn getmntinfo
3939318Smckusickreturns a count of the number of elements in the array.
4039318SmckusickThe pointer to the array is stored into
4148352Scael.Fa mntbufp .
4248352Scael.Pp
4345628SbosticIf an error occurs, zero is returned and the external variable
4448352Scael.Va errno
4545628Sbosticis set to indicate the error.
4645628SbosticAlthough the pointer
4748352Scael.Fa mntbufp
4845628Sbosticwill be unmodified, any information previously returned by
4948352Scael.Fn getmntinfo
5045628Sbosticwill be lost.
5148352Scael.Sh ERRORS
5248352ScaelThe
5348352Scael.Fn getmntinfo
5448352Scaelfunction
5548352Scaelmay fail and set errno for any of the errors specified for the library
5648352Scaelroutines
5748352Scael.Xr getfsstat 2
5848352Scaelor
5948352Scael.Xr malloc 3 .
6048352Scael.Sh SEE ALSO
6148352Scael.Xr getfsstat 2 ,
6248352Scael.Xr statfs 2 ,
6348352Scael.Xr mount 2 ,
6448352Scael.Xr mount 8
6548352Scael.Sh HISTORY
6648352ScaelThe
6748352Scael.Fn getmntinfo
6862868Sbosticfunction first appeared in 4.4BSD.
6948352Scael.Sh BUGS
7048352ScaelThe
7148352Scael.Fn getmntinfo
7248352Scaelfunction writes the array of structures to an internal static object
7348352Scaeland returns
7448352Scaela pointer to that object. Subsequent calls to
7548352Scael.Fn getmntinfo
7648352Scaelwill modify the same object.
7748352Scael.Pp
7845628SbosticThe memory allocated by
7948352Scael.Fn getmntinfo
8045628Sbosticcannot be
8148352Scael.Xr free 2 Ns 'd
8245628Sbosticby the application.
83