title: Retrieval of the error counters via TIOCGICOUNT returns always error (-1)
body: <p>I have come across a show stopping problem when developing an interface application for a USB to RS422 converter module.</p>
  <p>I need to retrieve the UART error counters for framing, overrun, parity and break errors. But the call to ioctl always returns -1 and the counter values from the retrieved struct are jumping to very big numbers.</p>
  <p>The code i am using to retrieve the counters is the following:</p>
  <pre class="lang-cpp prettyprint-override"><code>struct serial_icounter_struct counters;
  int ret = ioctl(portDescriptor, TIOCGICOUNT, &amp;counters);
  </code></pre>
  <p>To set the portDescriptor i am using a similar code to:</p>
  <pre class="lang-cpp prettyprint-override"><code>int portDescriptor = open(&quot;/dev/ttyUSB0&quot;, O_RDWR | O_NOCTTY | O_NDELAY);
  
  struct termios new_port_settings;
  //clear the new struct
  memset(&amp;new_port_settings, 0, sizeof(new_port_settings)); 
  
  //set port settings
  new_port_settings.c_cflag = B57600 | CS8 | CLOCAL | CREAD;
  new_port_settings.c_oflag = 0;
  new_port_settings.c_lflag = 0;
  new_port_settings.c_cc[VMIN] = 0;
  new_port_settings.c_cc[VTIME] = 0;
  
  int error = tcsetattr(portDescriptor, TCSANOW, &amp;new_port_settings)
  </code></pre>
  <p>Sometimes we also need to enable flow control or parity e.g.</p>
  <pre class="lang-cpp prettyprint-override"><code>new_port_settings.c_cflag = new_port_settings.c_cflag | CRTSCTS;
  </code></pre>
  <p>I have tried the code on a Ubuntu 11.10 32bit and on a SLES11 SP1 64bit, both with the FTDI_SIO kernel module.</p>
  <p>Is anybody aware of any kind of issue regarding the usage of TIOCGICOUNT or am I doing something wrong?</p>