title: How does fchdir work?
body: <p>In it's main page it says:</p>
  
  <blockquote>
    <p>fchdir() is identical to chdir(); the only difference is that the
    directory is given as an open file descriptor.</p>
  </blockquote>
  
  <p>And the prototype is given as following:</p>
  
  <blockquote>
    <p>int chdir(const char *path);<br>
    int fchdir(int fd);</p>
  </blockquote>
  
  <p>My question is how can a directory be passed as a file descriptor? Do directories also have a corresponding descriptor like files?</p>