title: Which C function is used to find out if a user exists on the system?
body: <p>Simple question; what is the function or library that i need to use to write a very simple program (in C) (linux, ubuntu) to find out whether a user exists on the system ? </p>
  
  <p>In bash i'd do : </p>
  
  <pre><code>'ls -la /home | grep $user | wc -l'
  </code></pre>
  
  <p>I think it's posix for C (or python) ? Can anyone help me to get started ? </p>
  
  <p>An example would be perfect like : </p>
  
  <pre><code> $ doesUserExist John
   0
  </code></pre>
  
  <p>or</p>
  
  <pre><code> $ doesUserExist John
   1
  </code></pre>
  
  <p>Thanks !</p>