title: What is the meaning of No such device or address(Error code 6)
body: <p>I am trying to open a serial port with using c code and I have created a node with the following command;</p>
  
  <pre><code>mknod /tmp/ttyACM0 c 100 0; 
  chmod 700 /tmp/ttyACM0;
  </code></pre>
  
  <p>and then run an executable file that opens a serial port with the following method;</p>
  
  <pre><code>static int OpenSerialPort(const char *bsdPath)
  {
  int                fileDescriptor = -1;
  struct termios    options;
  
  fileDescriptor = open(bsdPath, O_RDWR | O_NOCTTY | O_NONBLOCK);
  if (fileDescriptor == -1 || flock(fileDescriptor, LOCK_EX) == -1 )
  {
      printf("Error opening serial port %s - %s(%d).\n",
             bsdPath, strerror(errno), errno);
      goto error;
  }
  
  if (fcntl(fileDescriptor, F_SETFL, 0) == -1)
  {
      printf("Error clearing O_NONBLOCK %s - %s(%d).\n",
          bsdPath, strerror(errno), errno);
      goto error;
  }
  
  if (ioctl(fileDescriptor, TIOCEXCL, (char *) 0) &lt; 0) {
    printf("Error setting TIOCEXCL %s - %s(%d).\n",
        bsdPath, strerror(errno), errno);
    goto error;
  }
  memset(&amp;options,0,sizeof(options));
  
  options.c_iflag=0;
  options.c_oflag=0;
  options.c_cflag=CS8|CREAD|CLOCAL;
  options.c_lflag=0;
  options.c_cc[VMIN]=1;
  options.c_cc[VTIME]=5;
  cfsetospeed(&amp;options, B115200);
  cfsetispeed(&amp;options, B115200);
  
  if (tcsetattr(fileDescriptor, TCSANOW, &amp;options) == -1)
  {
      printf("Error setting tty attributes %s - %s(%d).\n",
          bsdPath, strerror(errno), errno);
      goto error;
  }
  
  return fileDescriptor;
  error:
  if (fileDescriptor != -1)
  {
      close(fileDescriptor);
  }
  exit(1);
  return -1;
  }
  </code></pre>
  
  <p>and it returns;</p>
  
  <pre><code>Error opening serial port /tmp/ttyACM0 - No such device or address(6).
  </code></pre>
  
  <p>There is actually a ttyACM0 file under /tmp directory but it returns me the error message. What can I do to pass this error?</p>
  
  <p>EDIT:
  When I look at the /proc/devices file, there is not a ttyACM0 device. Now I think my problem's reason can be this.</p>