title: IPC pipe through files /dev/ttyS0 and /dev/ttyS1
body: <p>I want to perform IPC pipe through serial port dev files. here are the requirements
  first of all I am trying to use</p>
  
  <pre><code>sudo socat /dev/ttyS0,raw,echo=0,crnl /dev/ttyS1,raw,echo=0,crnl
  </code></pre>
  
  <p>it is giving an error as follows</p>
  
  <pre><code>2014/12/xx 10:33:19 socat[17848] E tcgetattr(4, 0x7fffe76ecaa0): Input/output error
  </code></pre>
  
  <p>Once the ttyS0 and ttyS1 are connected, I assume we can perform read/write operation as similar as using a pipe(), I will have two programs peer0.c and peer1.c, peer0.c opens /dev/ttyS0 and peer1.c opens /dev/ttyS1, 
  so that read write operation should be as follows</p>
  
  <pre><code>peer0=&gt;ttyS0---&gt;---ttyS1=&gt;peer1
  peer0&lt;=ttyS0---&lt;---ttyS1&lt;=peer1
  </code></pre>
  
  <p>and since /dev/ttyS(0/1) are system wide, i can run peer0.c program in one terminal and peer1.c in another, </p>
  
  <p>Basically, I have linux based embedded application program which when ported to target hardware it will be controlled by linux based PC via minicom UART interface. target opens its ttyS0 to read uart data sent from PC, in PC, commands will be sent to target via minicom.
  Now I want to run target application in same PC in one terminal and want to send command from another terminal/minicom. Also the communication should be bidirectional</p>
  
  <p>is it possible to achieve this goal?
  or is there any other similar way to achieve the same?</p>
  
  <p>thanks in advance</p>