title: linux programming: value of file descriptor is always 3
body: <p>I'm new to linux programming. I wrote a very simple program:</p>
  
  <pre class="lang-c prettyprint-override"><code>#include stdio.h
  #include fcntl.h
  #include sys/ioctl.h
  #include mtd/mtd-user.h
  #include errno.h
  
  int main( void )
  {
      int fd;
  
      fd = open("test.target", O_RDWR);
      printf("var fd = %d\n", fd);
      close(fd);
      perror("perror output:");
  
      return 0;
  }
  </code></pre>
  
  <p>test.target is created just using touch command. the program's output is:</p>
  
  <pre><code>var fd = 3
  perror output:: Success
  </code></pre>
  
  <p>I've tried to open other files, and the file descriptor was always 3.I remembered it's value should be a larger number.If this program has some errors?</p>