Question says it all. I want C function call that returns the list the mounted filesystems along with associated information such as filesystem type.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re looking for
getmntentand other*mntentfunctions family. See manpage For further reference.Code example taken from here and slightly modified.
/etc/mtabis a file that contains a list of mounted filesystems.Unfortunately, these functions are not in POSIX. But they’re manpaged and implemented in glibc, so I think they’re a better alternative than parsing
/proc.