title: Linux - Multiple Serial Port Communication with C
body: <p>I have a device with multiple serial ports that I am programming with embedded linux and I would like to communicate over these two ports simultaneously and asynchronously.</p>
  
  <p>I know how to write to one serial port such as:</p>
  
  <pre><code>bytes_sent = write( fd, &amp;(string[i]), 1 );
  </code></pre>
  
  <p>But that's to only one serial port</p>
  
  <p>do I use the termios struct and the c_cflags to differentiate ports?
  As you can see it's a little vague, I'm just kind of diving in and getting my feet wet with this, any general help to point me vaguely in the right direction will help.</p>