2

Hi I am writing an application which mounts cgroup as shown below

mount("cgroup", "/sys/fs/cgroup", "tmpfs",0,NULL);

I am able to do this but I want to add a check to know if this is already mounted, how do I do that using C/C++? Is there any API or system API to get mount information. I do not want to use system() call.

Ali asgar
  • 33
  • 4

1 Answers1

4

You want to enumerate /proc/mounts using getmntent_r

MSalters
  • 173,980
  • 10
  • 155
  • 350