title: create a ramdisk in C++ on linux
body: <p>I need to make a ramfs an mount it to an directory in linux using <em>c++</em>. I want to make it like a user (no <code>sudo</code>).</p>
  
  <p>I need to call an application on a file that i created and it will be often. Writing it to HDD is very slow. </p>
  
  <p>I found just: </p>
  
  <pre><code>system("mkdir /mnt/ram");
  system("mount -t ramfs -o size=20m ramfs /mnt/ram");
  </code></pre>
  
  <p>but that is not good. I want to be a regular user, and command <code>mount</code> can be called just as root.
  what can i do?</p>