1*48352Scael.\" Copyright (c) 1989, 1991 The Regents of the University of California. 239318Smckusick.\" All rights reserved. 339318Smckusick.\" 443571Strent.\" %sccs.include.redist.man% 539318Smckusick.\" 6*48352Scael.\" @(#)getmntinfo.3 6.5 (Berkeley) 04/19/91 739318Smckusick.\" 8*48352Scael.Dd 9*48352Scael.Dt GETMNTINFO 3 10*48352Scael.Os 11*48352Scael.Sh NAME 12*48352Scael.Nm getmntinfo 13*48352Scael.Nd get information about mounted file systems 14*48352Scael.Sh SYNOPSIS 15*48352Scael.Fd #include <sys/types.h> 16*48352Scael.Fd #include <sys/mount.h> 17*48352Scael.Ft int 18*48352Scael.Fn getmntinfo "int mntbufp" "int flags" 19*48352Scael.Sh DESCRIPTION 20*48352ScaelThe 21*48352Scael.Fn getmntinfo 22*48352Scaelfunction 2339318Smckusickreturns an array of 24*48352Scael.Xr statfs 2539318Smckusickstructures describing each currently mounted file system (see 26*48352Scael.Xr statfs 2 ) . 27*48352Scael.Pp 28*48352ScaelThe 29*48352Scael.Fn getmntinfo 30*48352Scaelfunction 3145628Sbosticpasses its 32*48352Scael.Fa flags 3345628Sbosticparameter transparently to 34*48352Scael.Xr getfsstat 2 . 35*48352Scael.Sh RETURN VALUES 3639318SmckusickOn successful completion, 37*48352Scael.Fn getmntinfo 3839318Smckusickreturns a count of the number of elements in the array. 3939318SmckusickThe pointer to the array is stored into 40*48352Scael.Fa mntbufp . 41*48352Scael.Pp 4245628SbosticIf an error occurs, zero is returned and the external variable 43*48352Scael.Va errno 4445628Sbosticis set to indicate the error. 4545628SbosticAlthough the pointer 46*48352Scael.Fa mntbufp 4745628Sbosticwill be unmodified, any information previously returned by 48*48352Scael.Fn getmntinfo 4945628Sbosticwill be lost. 50*48352Scael.Sh ERRORS 51*48352ScaelThe 52*48352Scael.Fn getmntinfo 53*48352Scaelfunction 54*48352Scaelmay fail and set errno for any of the errors specified for the library 55*48352Scaelroutines 56*48352Scael.Xr getfsstat 2 57*48352Scaelor 58*48352Scael.Xr malloc 3 . 59*48352Scael.Sh SEE ALSO 60*48352Scael.Xr getfsstat 2 , 61*48352Scael.Xr statfs 2 , 62*48352Scael.Xr mount 2 , 63*48352Scael.Xr mount 8 64*48352Scael.Sh HISTORY 65*48352ScaelThe 66*48352Scael.Fn getmntinfo 67*48352Scaelfunction is 68*48352Scael.Ud . 69*48352Scael.Sh BUGS 70*48352ScaelThe 71*48352Scael.Fn getmntinfo 72*48352Scaelfunction writes the array of structures to an internal static object 73*48352Scaeland returns 74*48352Scaela pointer to that object. Subsequent calls to 75*48352Scael.Fn getmntinfo 76*48352Scaelwill modify the same object. 77*48352Scael.Pp 7845628SbosticThe memory allocated by 79*48352Scael.Fn getmntinfo 8045628Sbosticcannot be 81*48352Scael.Xr free 2 Ns 'd 8245628Sbosticby the application. 83