title: Linux IOCTLs for USB2Serial
body: <p>I'm developing a program in C++ on Linux which interacts with a USB2Serial adapter to fetch some information from the remote terminal. I was able to set it the IOCTL on windows using the following code:</p>
  
  <pre><code> #define IOCTL_SERIAL_XOFF_COUNTER       CTL_CODE(FILE_DEVICE_SERIAL_PORT,28,METHOD_BUFFERED,FILE_ANY_ACCESS)
  
  unsigned char xoff_counter[] = {0xd0,0x07,0x00,0x00,0x05,0x00,0x00,0x00,0x13,0x00,0x00,0x00};
  
          bool result = DeviceIoControl(file,IOCTL_SERIAL_XOFF_COUNTER,
                                          &amp;xoff_counter, sizeof(xoff_counter),
                                          NULL,0,
                                          &amp;junk,
                                          &amp;o);
  </code></pre>
  
  <p>I tried doing the same on Linux using the following code:</p>
  
  <pre><code>#define SERIAL_XOFF_COUNTER 28
  
  unsigned char xoff_counter[] = {0xd0,0x07,0x00,0x00,0x05,0x00,0x00,0x00,0x13,0x00,0x00,0x00};
  
  int retVal = ioctl(fd,SERIAL_XOFF_COUNTER,xoff_counter);
              if(retVal &lt; 0){
                  cout &lt;&lt; "Error while setting ioctl:"&lt;&lt;strerror(errno)&lt;&lt;endl;
              }
  </code></pre>
  
  <p>This is raising an error when I run the program:</p>
  
  <pre><code>Error while setting ioctl:Inappropriate ioctl for device
  </code></pre>
  
  <p>If anyone has worked in these ioctls before, please let me know what the Linux equivalents are for this flag.<br> TIA!</p>