title: Open system call with parameter 0 as a flag
body: <p>Im trying to open a device file (but the question is mainly for a general file) and it's working with the next line </p>
  
  <pre><code>fd = open(path,0);
  </code></pre>
  
  <p>but failed with the following line</p>
  
  <pre><code>fd = open(path,O_RDONLY,0777)
  </code></pre>
  
  <p>(even without the mode 0777)
  I just dont understand what is the meaning of puting 0 instead of a flag and why its working.</p>