C / C++ / C#: Howto do "mount -a"

Posted by Quandary on Stack Overflow See other posts from Stack Overflow or by Quandary
Published on 2012-05-30T16:23:54Z Indexed on 2012/05/30 16:41 UTC
Read the original article Hit count: 107

Filed under:
|
|
|
|

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...

© Stack Overflow or respective owner

Related posts about c#

Related posts about c++