title: how to check if the file is closed
body: <p>I have file descriptor and inside my signal handler, i close the file. But due to other conditions, the file could have been closed earlier. Is there a way to check if the file descriptor points to an open file in c and linux?</p>
  
  <p>UPDATE:
  Is it possible to determine filename associated with a file descriptor? This way if the fd gets recycled, app can detect it.</p>