title: When is umask() useful?
body: <pre><code>umask(0);
  
  fd = open("/dev/null", O_RDWR);
  </code></pre>
  
  <p>Here's <code>man 2 umask</code>:</p>
  
  <pre><code>umask() sets the calling process’s file mode creation mask (umask) to mask &amp; 0777.
  </code></pre>
  
  <p>But it doesn't make sense for me,as when we call <code>open</code> ,we will also provide a mode parameter.</p>
  
  <p>So what's the point of <code>umask</code>?</p>