C / C++ / C#: Howto do "mount -a"
c, c#, c++, linux, system-calls
Solution
`getmntent` can help you read `/etc/fstab` (and then use the mount function in the other answers).
Problem
Question: In C/C++/C#. (I need it for C#, but C and C++ is also fine). How can I do a mount -a on Linux. I mean programmatically, without starting a process like ``` system("mount -a"); ``` Edit: Note the "-a". My question is not actually about how to mount A mountpoint. It's about how to mount ALL mountpoints in /etc/fstab. That means parsing the file, extracting the mountpoints, check if already mounted, and only if not already mounted, mount...