title: linux mkdir function can't authorize full permission
body: <p>I am testing the <code>mkdir</code> function to create a new directory: </p>
  
  <pre><code>folder =  mkdir("./linux", 511);
  </code></pre>
  
  <p>or</p>
  
  <pre><code> folder = mkdir("./linux", 0777);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>folder = mkdir("./linux", S_IRWXU | S_IRWXG | S_IRWXO);
  </code></pre>
  
  <p>As you can see, I try to authorize the full permission to the directory but here's what comes up with <code>ls -l | grep linux</code>:</p>
  
  <pre><code>drwxr-xr-x 2 manuzhang manuzhang 4096 2012-01-04 06:53 linux
  </code></pre>
  
  <p>why can't I authorize write permission for group and others?</p>
  
  <p><strong>Updates</strong>:<br>
  weird thing, as you guys told me I tried <code>umask</code>. It works with either <code>umask(S_IWGRP)</code> or <code>umask(S_IWOTH)</code> but <strong>fails</strong> with <code>umask(S_IWGRP | S_IWOTH)</code>, any ideas?</p>