GETMNTINFO(3)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

🌸 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 to getmntinfo() will modify the same object.
  • The memory allocated by getmntinfo() cannot be free(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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms