title: How to set errno value?
body: <p>I have two calls to two different methods : </p>
  
  <pre><code>void func1() 
  {
    // do something 
    if (fail) 
    {
      // then set errno to EEXIST
  
    }
  
  }
  </code></pre>
  
  <p>And the second method : </p>
  
  <pre><code>void func2() 
  {
    // do something 
    if (fail) 
    {
      // then set errno to ENOENT
  
    }
  
  }
  </code></pre>
  
  <ol>
  <li><p>When I set the <code>errno</code> to some value , what does it do ? just error checking ? </p></li>
  <li><p>How can I set <code>errno</code> in the above methods <code>func1</code> and <code>func2</code> to <code>EEXIST</code> and <code>ENOENT</code> </p></li>
  </ol>
  
  <p>Thanks </p>