GETMNTINFO(3)
πΈ getmntinfo β get information about mounted file systems πΈ
okay bestie, this is the getmntinfo page from the Library Functions Manual, section 3, and it's literally here to hand you the tea on mounted file systems. π
β¨ NAME β¨
getmntinfo β get information about mounted file systems
π LIBRARY π
Standard C Library (libc, -lc)
π§ SYNOPSIS π§
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
int
getmntinfo(struct statfs **mntbufp, int mode);
π DESCRIPTION π
The getmntinfo() function returns an array of statfs() structures describing each currently mounted file system (see statfs(2)). β¨
The getmntinfo() function passes its mode argument transparently to getfsstat(2). no cap, it just hands it straight over. π«Ά
π«Ά RETURN VALUES π«Ά
On successful completion, getmntinfo() returns a count of the number of elements in the array. The pointer to the array is stored into mntbufp. slay. π
If an error occurs, zero is returned and the external variable errno is set to indicate the error. Although the pointer mntbufp will be unmodified, any information previously returned by getmntinfo() will be lost. π that's the dramatic part.
π ERRORS π
The getmntinfo() function may fail and set errno for any of the errors specified for the library routines getfsstat(2) or malloc(3).
π¦ SEE ALSO π¦
π HISTORY π
The getmntinfo() function first appeared in 4.4BSD. iconic behavior, honestly.
π BUGS π
bestie, listen: this is the important caveat. π
- The
getmntinfo()function writes the array of structures to an internal static object and returns a pointer to that object. Subsequent calls togetmntinfo()will modify the same object. - The memory allocated by
getmntinfo()cannot befree(3)'d by the application.
π that's the whole page, bestie! this one's from Debian, dated December 27, 2016, and it's the GETMNTINFO(3) page β mwah! ππ
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1989, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms