148352Scael.\" Copyright (c) 1989, 1991 The Regents of the University of California. 239318Smckusick.\" All rights reserved. 339318Smckusick.\" 443571Strent.\" %sccs.include.redist.man% 539318Smckusick.\" 6*57534Sbostic.\" @(#)getmntinfo.3 6.7 (Berkeley) 01/14/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 19*57534Sbostic.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 6848352Scaelfunction is 6948352Scael.Ud . 7048352Scael.Sh BUGS 7148352ScaelThe 7248352Scael.Fn getmntinfo 7348352Scaelfunction writes the array of structures to an internal static object 7448352Scaeland returns 7548352Scaela pointer to that object. Subsequent calls to 7648352Scael.Fn getmntinfo 7748352Scaelwill modify the same object. 7848352Scael.Pp 7945628SbosticThe memory allocated by 8048352Scael.Fn getmntinfo 8145628Sbosticcannot be 8248352Scael.Xr free 2 Ns 'd 8345628Sbosticby the application. 84