title: tcsetattr() fails
body: <blockquote>
    <p>&amp;"warning: GDB: Failed to set controlling terminal: Inappropriate
    ioctl for device\n"</p>
  </blockquote>
  
  <pre><code>   bool rs485::rs485ConfigPort()
      {
          termios portSettings;
  
          memset(&amp;portSettings, 0, sizeof(portSettings));
  
          portSettings.c_cflag |= (CLOCAL | CREAD);
  
          cfsetispeed(&amp;portSettings, B57600);
  
          portSettings.c_cflag &amp;= ~PARENB;
  
          portSettings.c_cflag |= CS8;
  
          portSettings.c_cflag &amp;= ~CSIZE;
  
          portSettings.c_cflag &amp;= ~CSTOPB; //stop bit = 1
  
          //cfmakeraw(&amp;portSettings);
  
          if (tcsetattr(fd, TCSANOW, &amp;portSettings))
          {
              emit logMessage("Can not adjust port settings");
  
              close(fd);
              return false;
          }
  
          tcflush(fd, TCIFLUSH);
          return true;
      }
  </code></pre>
  
  <p>I found the problem, this is because tcsetattr() gives back Input/Output Error.
  the device is open with write permissions. and... when I do dmesg | grep ttyS0 or S1-3, I do not receive anything! it also follows sometimes with the error "No such device".</p>
  
  <p>anybody can help solve this problem?</p>