title: How to interrupt a fread call?
body: <p>I have the following situation:</p>
  
  <p>There is a thread that reads from a device with a fread call. This call is blocking as long as there is no data send from the device. 
  When I stop this thread it remains hanging inside this thread. </p>
  
  <p>Now I found the following inside the man page of fread:</p>
  
  <blockquote>
    <p><strong>ERRORS</strong></p>
    
    <p>On all systems that conform to the
    Single UNIX Specification, the fread()
    function sets errno as listed for the
    following conditions:</p>
    
    <p>[EINTR] The read operation was
    terminated due to the receipt of a
    signal, and no data was transferred.</p>
  </blockquote>
  
  <p>That would mean there is a way to interrupt the call from a different thread. But I have no idea how. Can someone tell me how to send a signal to interrupt the fread call? And what signal I need to send?</p>
  
  <hr>
  
  <p><strong>Update 08-10-10 09:25</strong></p>
  
  <p>I still haven't got it to work. I tryed the kill() and pthread_kill() with different signals. But nothing seems to interrupt the fread() call. The only thing that I got working is killing the entire application, but that's not what I want. </p>