title: How to implement a timeout in read() function call?
body: <p>I want to use serial com port for communication and I want to implement a timeout every time I call the <em>read()</em> function call.</p>
  <pre><code>int filedesc = open( &quot;dev/ttyS0&quot;, O_RDWR );
  
  read( filedesc, buff, len );
  </code></pre>
  <p>EDIT:</p>
  <p>I'm using Linux OS. How to implement using select function call?</p>