NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO | HISTORY | BUGS | RESTRICTIONS
#include <sys/param.h> #include <sys/ucred.h> #include <sys/mount.h>int getmntinfo(struct statfs **mntbufp, int flags);
The getmntinfo function returns an array of statfs structures describing each file system currently mounted (see stafs(2POSIX))
The getmntinfo function passes its flags parameter transparently to getfsstat(2POSIX).
On successful completion, getmntinfo returns a count of the number of elements in the array. The pointer to the array is stored in mntbufp.
If an error occurs, zero is returned and the external variable errno is set to indicate the error. Although the mntbufp pointer will be unmodified, any information previously returned by getmntinfo will be lost.
The getmntinfo function may fail and set errno to any of the errors specified for the getfsstat(2POSIX) or malloc(3STDC) library routines.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
The getmntinfo function first appeared in 4.4 BSD.
The getmntinfo function writes the array of structures to an internal static object and returns a pointer to that object. Subsequent calls to getmntinfo will modify that object.
The memory allocated by getmntinfo cannot be freed by the application.
This library call does not support multi-threaded applications.
NAME | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO | HISTORY | BUGS | RESTRICTIONS